from caffe2.python import workspace(ImportError: No module named 'past')

版权声明:转载请附此链接 https://blog.csdn.net/qq_42393859/article/details/88988839

现在caffe2整合到pytorch1.0中,无需单独配置编译

之前遇到此问题,特此记录

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/hitachi/.local/lib/python3.5/site-packages/caffe2/python/workspace.py", line 15, in <module>
    from past.builtins import basestring
ImportError: No module named 'past'

解决方法:pip3 install --user future

验证caffe2方法:

# To check if Caffe2 build was successful
python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"

# To check if Caffe2 GPU build was successful
# This must print a number > 0 in order to use Detectron
python -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'

猜你喜欢

转载自blog.csdn.net/qq_42393859/article/details/88988839