raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
解决方法:是由于python的版本没有包含tkinter的模块,只需要把tk的package安装就可以了。
终端输入命令进行安装:
sudo apt-get install python3-tk
——————————————————————————————————————————
matplotlib报错_tkinter.TclError: no display name and no $DISPLAY environment variable
解决:这是因为我的linux系统下没有界面导致的,添加使用Agg
import matplotlib
matplotlib.use(‘Agg’)
——————————————————————————————————————————
tensorflow 中运行 tf.summary.FileWriter()发生 /tensorboard; Permission denied error的解决办法
解决:把TENSORBOARD_DIR的值从相对路径改为绝对路径
————————————————————————————————————-
“TypeError: ‘dict_keys’ object is not subscriptable”
源代码:color_list = colors.cnames.keys()[::6]
解决:这是python3的原因,不允许对key切片,需要先转成list
color_list=list(colors.cnames.keys())
color_list=color_list[::6]
————————————————————————————————————————————————————————————
xml文件转化成tfrecord格式出现错误TypeError: None has type NoneType, but expected one of: int, long
解决:仔细检查数据,看图片和标注是否匹配,检查xml文件,读取是是否读了不存在的标签。我就是标签拼错了。。。
——————————————————————————————————————
2018-09-28 17:11:38.212311: E tensorflow/stream_executor/cuda/cuda_driver.cc:1078] failed to synchronize the stop event: CUDA_ERROR_ECC_UNCORRECTABLE
2018-09-28 17:11:38.212378: E tensorflow/stream_executor/cuda/cuda_timer.cc:55] Internal: error destroying CUDA event in context 0xa136b80: CUDA_ERROR_ECC_UNCORRECTABLE
2018-09-28 17:11:38.212432: E tensorflow/stream_executor/cuda/cuda_timer.cc:60] Internal: error destroying CUDA event in context 0xa136b80: CUDA_ERROR_ECC_UNCORRECTABLE
2018-09-28 17:11:38.212491: F tensorflow/stream_executor/cuda/cuda_dnn.cc:211] Check failed: status == CUDNN_STATUS_SUCCESS (7 vs. 0)Failed to set cuDNN stream.
解决方法:我是在服务器上跑的,大概是使用了别人的gpu,把gpu从1改到了0就好了。
————————————————————————————————————
ImportError: /home/user10/notebook/TensorFlow-R-FCN-for-primary-students/tools/../lib/utils/cython_nms.cpython-35m-x86_64-linux-gnu.so: cannot open shared object file: Permission denied
解决方法:权限问题,这接把文件权限变成777,
chmod 777 cython_nms.cpython-35m-x86_64-linux-gnu.so
————————————————————————————————————
reload(sys)
sys.setdefaultencoding("utf-8")12
在Python 3.x中不好使了 提示 name ‘reload’ is not defined
在3.x中已经被毙掉了被替换为
import importlib
importlib.reload(sys)12
sys.setdefaultencoding(“utf-8”) 这种方式在3.x中被彻底遗弃
——————————————————————————————————
a bytes-like object is required, not ‘str’
解决:byte与str之间的转换,str通过encode()方法可以编码为指定的bytes
反过来,如果我们从网络或磁盘上读取了字节流,那么读到的数据就是bytes。要把bytes变为str,就需要用decode()方法: