tensorflow遇到的问题
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
代码解读
解决方法:这一问题源于Python版本中缺少tkinter模块,请先安装tk包以解决问题。
在终端中执行安装命令:使用apt-get安装python3-tk模块并完成配置操作。
软件报错提示信息分析:由于我的Linux系统缺乏图形界面导致了此错误,请检查并配置好显示设置后重新启动程序。
在TensorFlow环境中运行tf.summary.FileWriter()时会遇到/tensorboard权限不足的问题,请采取相应措施确保路径正确性并获得授权访问/tensorboard目录空间。
源代码示例显示color_list被定义为colors.cnames.keys()[::6]切片对象,请确保数据结构符合预期并适当调整切片操作以满足需求。
出现错误TypeError: None has type NoneType, but expected one of: int, long,请仔细检查数据读取流程及文件路径配置是否存在问题,并验证各组件之间是否存在兼容性问题导致程序异常终止运行状态。
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
代码解读
解决方法:权限设置问题,在此操作中将文件权限设为读、执行和可删除状态(即权限值为100),可以通过执行以下命令完成设置:chmod 755 cython_nms.cpython-35m-x86_64-linux-gnu.so
reload(sys)
sys.setdefaultencoding("utf-8")12
代码解读
在Python 3.x版本中使用起来并不顺畅:例如会触发提示错误:变量名'reload'未定义;而在这一版本中它已被移除并用其他功能替代
import importlib
importlib.reload(sys)12
代码解读
该方式已不再用于Python 3.x版本。
错误提示信息表明:
缺少必要的字节数对象(bytes-like object),当前获取的是字符串类型(str)。
解决办法是将byte与str进行转换。
具体来说:
可以通过encode()方法将字符串编码为指定类型的字节数。
相反地:
当我们从网络或存储设备读取数据时,
得到的数据类型是字节数类型(bytes)。
要将其转换为字符串类型(str),必须调用decode()方法。
