Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorpack Update and OpenCv dependency #16

Merged
merged 6 commits into from
Mar 17, 2018
Merged

Conversation

rizasif
Copy link
Contributor

@rizasif rizasif commented Mar 17, 2018

Hi,

The repository in the current form was not functional due to an update with Tensorpack. This pull request is inspired by the issue tensorpack/tensorpack#458. Moreover, it was found that OpenCv-Python is actually required for execution, hence, it was added as dependency in the ReadMe file.

I have made the necessary changes and tried them on my server with Ubuntu 17.04, Nvidia GTX-1050 and Cuda 8.0. It appears to be working fine now.

Please update.

Thank you.

@rizasif
Copy link
Contributor Author

rizasif commented Mar 17, 2018

Here is the error received if Tensorpack update not included.

[0317 16:22:46 @logger.py:119] Use a new log directory train_log/cifar10-single-fisrt150-second225-max3000317-162246
[0317 16:22:46 @logger.py:74] Argv: cifar10-densenet.py --gpu=1
[0317 16:22:46 @fs.py:89] WRN Env var $TENSORPACK_DATASET not set, using /home/turanshare/tensorpack_data for datasets.
[0317 16:22:46 @cifar.py:33] Found cifar10 data in /home/turanshare/tensorpack_data/cifar10_data.
[0317 16:22:47 @parallel.py:178] [MultiProcessPrefetchData] Will fork a dataflow more than one times. This assumes the datapoints are i.i.d.
[0317 16:22:47 @cifar.py:33] Found cifar10 data in /home/turanshare/tensorpack_data/cifar10_data.
[0317 16:22:47 @base.py:344] WRN You're calling new trainers with old trainer API!
[0317 16:22:47 @base.py:345] WRN Now it returns the old trainer for you, please switch to use new trainers soon!
[0317 16:22:47 @base.py:346] WRN See https://github.com/ppwwyyxx/tensorpack/issues/458 for more information.
Traceback (most recent call last):
  File "cifar10-densenet.py", line 179, in <module>
    launch_train_with_config(config, SyncMultiGPUTrainer(config))
  File "/home/turanshare/anaconda2/envs/tensorflow/lib/python3.6/site-packages/tensorpack/train/trainers.py", line 104, in SyncMultiGPUTrainer
    return SyncMultiGPUTrainerParameterServer(gpus, ps_device='cpu')
  File "/home/turanshare/anaconda2/envs/tensorflow/lib/python3.6/site-packages/tensorpack/train/base.py", line 347, in __new__
    return old_trainer(*args, **kwargs)
  File "/home/turanshare/anaconda2/envs/tensorflow/lib/python3.6/site-packages/tensorpack/trainv1/multigpu.py", line 61, in __init__
    apply_prefetch_policy(config, gpu_prefetch)
  File "/home/turanshare/anaconda2/envs/tensorflow/lib/python3.6/site-packages/tensorpack/trainv1/multigpu.py", line 42, in apply_prefetch_policy
    if len(config.tower) > 1 and gpu_prefetch:
AttributeError: 'TrainConfig' object has no attribute 'tower'

@rizasif rizasif mentioned this pull request Mar 17, 2018
@rizasif
Copy link
Contributor Author

rizasif commented Mar 17, 2018

The OpenCv output can be viewed here #15 (comment)

if args.gpu:
config.nr_tower = len(args.gpu.split(','))
SyncMultiGPUTrainer(config).train()
else:
config.nr_tower = 0
Copy link
Contributor

@ppwwyyxx ppwwyyxx Mar 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting config.nr_tower has no effect any more.
Using SyncMultiGPUTrainer(num_gpu) is sufficient.

ppwwyyxx added a commit to tensorpack/tensorpack that referenced this pull request Mar 17, 2018
@rizasif
Copy link
Contributor Author

rizasif commented Mar 17, 2018

@ppwwyyxx please check now

@ppwwyyxx
Copy link
Contributor

Looks good!

@YixuanLi YixuanLi merged commit ea993af into YixuanLi:master Mar 17, 2018
@rizasif
Copy link
Contributor Author

rizasif commented Mar 17, 2018

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants