Unverified Commit 1958adb0 authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Fix windows pipeline timeout (#2050)

parent 73a6990b
......@@ -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)
......
......@@ -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
......
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: |
......
jobs:
- job: 'integration_test_local_ubuntu'
timeoutInMinutes: 0
steps:
- script: python3 -m pip install --upgrade pip setuptools --user
......
jobs:
- job: 'integration_test_remote_windows'
timeoutInMinutes: 0
steps:
- script: python -m pip install --upgrade pip setuptools
......
jobs:
- job: 'integration_test_remote'
timeoutInMinutes: 0
steps:
- script: python3 -m pip install --upgrade pip setuptools --user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment