Tencent / PocketFlow

An Automatic Model Compression (AutoMC) framework for developing smaller and faster AI applications.
https://pocketflow.github.io
Other
2.78k stars 490 forks source link

ImportError: No module named multi_gpu_wrapper #97

Closed iamhankai closed 5 years ago

iamhankai commented 5 years ago

running log:

test@test-Alienware-Aurora-R7:~/hankai/PocketFlow-master$ ./scripts/run_local.sh nets/resnet_at_cifar10_run.py
Python script: nets/resnet_at_cifar10_run.py
\# of GPUs: 1
extra arguments:  --model_http_url https://api.ai.tencent.com/pocketflow --data_dir_local /home/test/hankai/cifar/cifar-10-batches-py
Traceback (most recent call last):
  File "utils/get_idle_gpus.py", line 40, in <module>
    for gpu in gpu_smi_output.split(sep='\n')[:-1]:
TypeError: split() takes no keyword arguments
'nets/resnet_at_cifar10_run.py' -> 'main.py'
multi-GPU training disabled
[WARNING] TF-Plus & Horovod cannot be imported; multi-GPU training is unsupported
Traceback (most recent call last):
  File "main.py", line 23, in <module>
    from learners.learner_utils import create_learner
  File "/home/test/hankai/PocketFlow-master/learners/learner_utils.py", line 22, in <module>
    from learners.weight_sparsification.learner import WeightSparseLearner
  File "/home/test/hankai/PocketFlow-master/learners/weight_sparsification/learner.py", line 26, in <module>
    from learners.weight_sparsification.pr_optimizer import PROptimizer
  File "/home/test/hankai/PocketFlow-master/learners/weight_sparsification/pr_optimizer.py", line 29, in <module>
    from utils.multi_gpu_wrapper import MultiGpuWrapper as mgw
ImportError: No module named multi_gpu_wrapper

It seems that the code wants to import module from /home/test/hankai/PocketFlow-master/learners/weight_sparsification/ rather than the home path. How to fix it?

jiaxiang-wu commented 5 years ago

@iamhankai Which one are you using, Python 2.x or Python 3.x?

iamhankai commented 5 years ago

@iamhankai Which one are you using, Python 2.x or Python 3.x?

I have tried Python2.7

update:

Using Python3.5 fixed it.