chenyuntc/pytorch-best-practice

--max-epoch = 20 TypeError: ''str' object cannot be interpreted as an integer'

snorlaxse opened this issue · 0 comments

$ CUDA_VISIBLE_DEVICES='2,3' python main.py train --train-data-root=data/train/ --lr=0.005 --batch-size=32 --model='ResNet34' --max-epoch = 20 --use-gpu --env=classifier

TypeError: 'str' object cannot be interpreted as an integer

user config:
env classifier
vis_port 8097
model ResNet34
train_data_root data/train/
test_data_root ./data/test1
load_model_path None
batch_size 32
use_gpu True
num_workers 4
print_freq 20
debug_file /tmp/debug
result_file result.csv
max_epoch =
lr 0.005
lr_decay 0.5
weight_decay 0.0
WARNING:root:Setting up a new session...
WARNING:visdom:Without the incoming socket you cannot receive events from the server or register event handlers to your Visdom client.
Traceback (most recent call last):
  File "main.py", line 168, in <module>
    fire.Fire()
  File "/home/deepliver4/.conda/envs/py36/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/home/deepliver4/.conda/envs/py36/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/home/deepliver4/.conda/envs/py36/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "main.py", line 79, in train
    for epoch in range(opt.max_epoch):
TypeError: 'str' object cannot be interpreted as an integer