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
1958adb0
Unverified
Commit
1958adb0
authored
Feb 12, 2020
by
chicm-ms
Committed by
GitHub
Feb 12, 2020
Browse files
Fix windows pipeline timeout (#2050)
parent
73a6990b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
5 deletions
+15
-5
examples/trials/cifar10_pytorch/main.py
examples/trials/cifar10_pytorch/main.py
+9
-2
test/config_test/examples/cifar10-pytorch.test.yml
test/config_test/examples/cifar10-pytorch.test.yml
+1
-1
test/pipelines-it-local-windows.yml
test/pipelines-it-local-windows.yml
+2
-2
test/pipelines-it-local.yml
test/pipelines-it-local.yml
+1
-0
test/pipelines-it-remote-windows.yml
test/pipelines-it-remote-windows.yml
+1
-0
test/pipelines-it-remote.yml
test/pipelines-it-remote.yml
+1
-0
No files found.
examples/trials/cifar10_pytorch/main.py
View file @
1958adb0
...
...
@@ -99,7 +99,7 @@ def prepare(args):
# Training
def
train
(
epoch
):
def
train
(
epoch
,
batches
=-
1
):
global
trainloader
global
testloader
global
net
...
...
@@ -129,6 +129,9 @@ def train(epoch):
progress_bar
(
batch_idx
,
len
(
trainloader
),
'Loss: %.3f | Acc: %.3f%% (%d/%d)'
%
(
train_loss
/
(
batch_idx
+
1
),
100.
*
correct
/
total
,
correct
,
total
))
if
batches
>
0
and
(
batch_idx
+
1
)
>=
batches
:
return
def
test
(
epoch
):
global
best_acc
global
trainloader
...
...
@@ -176,6 +179,10 @@ def test(epoch):
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--epochs"
,
type
=
int
,
default
=
200
)
# Maximum mini-batches per epoch, for code testing purpose
parser
.
add_argument
(
"--batches"
,
type
=
int
,
default
=-
1
)
args
,
_
=
parser
.
parse_known_args
()
try
:
...
...
@@ -187,7 +194,7 @@ if __name__ == '__main__':
acc
=
0.0
best_acc
=
0.0
for
epoch
in
range
(
start_epoch
,
start_epoch
+
args
.
epochs
):
train
(
epoch
)
train
(
epoch
,
args
.
batches
)
acc
,
best_acc
=
test
(
epoch
)
nni
.
report_intermediate_result
(
acc
)
...
...
test/config_test/examples/cifar10-pytorch.test.yml
View file @
1958adb0
...
...
@@ -13,7 +13,7 @@ assessor:
optimize_mode
:
maximize
trial
:
codeDir
:
../../../examples/trials/cifar10_pytorch
command
:
python3 main.py --epochs
2
command
:
python3 main.py --epochs
1 --batches
1
gpuNum
:
1
useAnnotation
:
false
...
...
test/pipelines-it-local-windows.yml
View file @
1958adb0
jobs
:
-
job
:
'
Test'
-
job
:
'
integration_test_local_windows'
timeoutInMinutes
:
0
steps
:
-
script
:
|
...
...
@@ -9,7 +10,6 @@ jobs:
python -m pip install scikit-learn==0.20.0 --user
python -m pip install keras==2.1.6 --user
python -m pip install torch===1.2.0 torchvision===0.4.1 -f https://download.pytorch.org/whl/torch_stable.html --user
python -m pip install torchvision --user
python -m pip install tensorflow-gpu==1.11.0 --user
displayName
:
'
Install
dependencies
for
integration
tests'
-
script
:
|
...
...
test/pipelines-it-local.yml
View file @
1958adb0
jobs
:
-
job
:
'
integration_test_local_ubuntu'
timeoutInMinutes
:
0
steps
:
-
script
:
python3 -m pip install --upgrade pip setuptools --user
...
...
test/pipelines-it-remote-windows.yml
View file @
1958adb0
jobs
:
-
job
:
'
integration_test_remote_windows'
timeoutInMinutes
:
0
steps
:
-
script
:
python -m pip install --upgrade pip setuptools
...
...
test/pipelines-it-remote.yml
View file @
1958adb0
jobs
:
-
job
:
'
integration_test_remote'
timeoutInMinutes
:
0
steps
:
-
script
:
python3 -m pip install --upgrade pip setuptools --user
...
...
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