Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
bbda6a8a
Unverified
Commit
bbda6a8a
authored
Aug 13, 2020
by
chicm-ms
Committed by
GitHub
Aug 13, 2020
Browse files
Replace tensorboardX with torch.utils.tensorboard (#2786)
parent
f6991e8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
azure-pipelines.yml
azure-pipelines.yml
+0
-4
src/sdk/pynni/nni/compression/torch/pruning/amc/amc_pruner.py
...sdk/pynni/nni/compression/torch/pruning/amc/amc_pruner.py
+2
-3
No files found.
azure-pipelines.yml
View file @
bbda6a8a
...
...
@@ -28,7 +28,6 @@ jobs:
set -e
sudo apt-get install -y pandoc
python3 -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html --user
python3 -m pip install tensorboardX==1.9
python3 -m pip install tensorflow==2.2.0 --user
python3 -m pip install keras==2.4.2 --user
python3 -m pip install gym onnx peewee thop --user
...
...
@@ -69,7 +68,6 @@ jobs:
-
script
:
|
set -e
python3 -m pip install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html --user
python3 -m pip install tensorboardX==1.9
python3 -m pip install tensorflow==1.15.2 --user
python3 -m pip install keras==2.1.6 --user
python3 -m pip install gym onnx peewee --user
...
...
@@ -119,7 +117,6 @@ jobs:
set -e
# pytorch Mac binary does not support CUDA, default is cpu version
python3 -m pip install torchvision==0.6.0 torch==1.5.0 --user
python3 -m pip install tensorboardX==1.9
python3 -m pip install tensorflow==1.15.2 --user
brew install swig@3
rm -f /usr/local/bin/swig
...
...
@@ -147,7 +144,6 @@ jobs:
python -m pip install scikit-learn==0.23.2 --user
python -m pip install keras==2.1.6 --user
python -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html --user
python -m pip install tensorboardX==1.9
python -m pip install tensorflow==1.15.2 --user
displayName
:
'
Install
dependencies'
-
script
:
|
...
...
src/sdk/pynni/nni/compression/torch/pruning/amc/amc_pruner.py
View file @
bbda6a8a
...
...
@@ -6,6 +6,7 @@ from copy import deepcopy
from
argparse
import
Namespace
import
numpy
as
np
import
torch
from
torch.utils.tensorboard
import
SummaryWriter
from
nni.compression.torch.compressor
import
Pruner
from
.channel_pruning_env
import
ChannelPruningEnv
...
...
@@ -148,8 +149,6 @@ class AMCPruner(Pruner):
epsilon
=
50000
,
seed
=
None
):
from
tensorboardX
import
SummaryWriter
self
.
job
=
job
self
.
searched_model_path
=
searched_model_path
self
.
export_path
=
export_path
...
...
@@ -189,7 +188,7 @@ class AMCPruner(Pruner):
if
self
.
job
==
'train_export'
:
print
(
'=> Saving logs to {}'
.
format
(
self
.
output_dir
))
self
.
tfwriter
=
SummaryWriter
(
logdir
=
self
.
output_dir
)
self
.
tfwriter
=
SummaryWriter
(
log
_
dir
=
self
.
output_dir
)
self
.
text_writer
=
open
(
os
.
path
.
join
(
self
.
output_dir
,
'log.txt'
),
'w'
)
print
(
'=> Output path: {}...'
.
format
(
self
.
output_dir
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment