【Error】跑CNN程序时遇到的error(持续更新)

来源:互联网 发布:喜马拉雅提示网络错误 编辑:程序博客网 时间:2024/06/05 03:54

前言

记性不好,把一些error记录一下,没准什么时候又遇到了。

IndentationError

记录时间:2017.08.10

错误提示:
IndentationError: unexpected indent
错误原因:python对代码格式要求严格,很可能是因为代码格式错误导致问题,检查一下有没有注释符破坏代码格式

ImportError

记录时间:2017.08.07

错误描述:在安装人脸识别库face_recognition时,import错误
错误提示:
Traceback (most recent call last):  File "find_faces_in_picture.py", line 2, in <module>    import face_recognition  File "/usr/local/lib/python3.6/site-packages/face_recognition/__init__.py", line 7, in <module>    from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces, face_distance  File "/usr/local/lib/python3.6/site-packages/face_recognition/api.py", line 4, in <module>    import dlib  File "/usr/local/lib/python3.6/site-packages/dlib-19.4.99-py3.6-macosx-10.11-x86_64.egg/dlib/__init__.py", line 1, in <module>    from .dlib import *ImportError: dlopen(/usr/local/lib/python3.6/site-packages/dlib-19.4.99-py3.6-macosx-10.11-x86_64.egg/dlib/dlib.so, 2): Symbol not found: _PyClass_Type  Referenced from: /usr/local/opt/boost-python/lib/libboost_python-mt.dylib  Expected in: flat namespace in /usr/local/opt/boost-python/lib/libboost_python-mt.dylib
解决办法:可能由于本机多版本的Python环境,使得安装的依赖boost-python为python2版本,改成python3版本就可以了,之后需要重新执行cmake,代码如下:
brew uninstall boost-pythonbrew install boost-python --with-python3 --without-pythongit clone https://github.com/davisking/dlib.gitcd dlibmkdir build; cd build; cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1; cmake --build .cd ..python3 setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA

记录时间:2017.07.11

错误提示:
ImportError:Importing the multiarray numpy extension module failed. Mostlikely you are trying to import a failed build of numpy.If you're working with a numpy git repo, try `git clean -xdf` (removes allfiles not under version control). Otherwise reinstall numpy.
解决办法:因为多版本python影响numpy调用,pip uninstall numpy;pip install numpy之后就好了



阅读全文
1 0
原创粉丝点击