Skip to content

Commit

Permalink
Miss a 'None' in return values of create_model() in tools/train_net.py
Browse files Browse the repository at this point in the history
Summary:
When 'model_final.pkl' exists, the following error occurs:
```shell
INFO train_net.py: 184: model_final.pkl exists; no need to train!
Traceback (most recent call last):
  File "tools/train_net.py", line 280, in <module>
    main()
  File "tools/train_net.py", line 119, in main
    checkpoints = train_model()
  File "tools/train_net.py", line 128, in train_model
    model, weights_file, start_iter, checkpoints, output_dir = create_model()
ValueError: need more than 4 values to unpack
```
It misses a return value.
Closes facebookresearch#309

Reviewed By: ir413

Differential Revision: D7366733

Pulled By: rbgirshick

fbshipit-source-id: c37b3b2e5b2aff38d46ca521a9d79613049255cb
  • Loading branch information
shenyunhang authored and facebook-github-bot committed Mar 22, 2018
1 parent e7ad1b4 commit 7d8da09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/train_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def create_model():
final_path = os.path.join(output_dir, 'model_final.pkl')
if os.path.exists(final_path):
logger.info('model_final.pkl exists; no need to train!')
return None, None, {'final': final_path}, output_dir
return None, None, None, {'final': final_path}, output_dir

# Find the most recent checkpoint (highest iteration number)
files = os.listdir(output_dir)
Expand Down

0 comments on commit 7d8da09

Please sign in to comment.