日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ImportError cannot import name BytesIO when import caffe

發布時間:2025/4/16 编程问答 84 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ImportError cannot import name BytesIO when import caffe 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉自:https://github.com/BVLC/caffe/issues/1549
I am trying to make caffe running on my machine equipped with Ubuntu 12.04LTS.
After finishing all the steps on the Installation page, I trained the LeNet model successfully and tried to use it as the tutorial from here. Then I got the following error:

Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named caffe Error in sys.excepthook: Traceback (most recent call last):File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthookfrom apport.fileutils import likely_packaged, get_recent_crashesFile "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>from apport.report import ReportFile "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module>import problem_reportFile "/usr/lib/python2.7/dist-packages/problem_report.py", line 14, in <module>import zlib, base64, time, sys, gzip, struct, osFile "/usr/lib/python2.7/gzip.py", line 10, in <module>import ioFile "${HOME}/path/to/caffe/python/caffe/io.py", line 2, in <module>import skimage.ioFile "/usr/local/lib/python2.7/dist-packages/skimage/io/__init__.py", line 11, in <module>from ._io import *File "/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py", line 1, in <module>from io import BytesIO ImportError: cannot import name BytesIOOriginal exception was: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named caffe

I set the PYTHONPATH in .bashrc file before I did the above.
What is the problem? Could anyone give some hint? I am really confused.

Solution:

This issue was also posted as a question on Stack Overflow;
it looks like you set your PYTHONPATH to include ${HOME}/path/to/caffe/python/caffe$
rather than
${HOME}/path/to/caffe/python $
(note the lack of the last caffe part in that).

總結

以上是生活随笔為你收集整理的ImportError cannot import name BytesIO when import caffe的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。