1、在conda tensorflow_gpu环境下可以运行预测程序,但是直接在cmd中运行预测程序,出现ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' 错误。解决方式:更新numpy
查看numpy的当前版本
conda list numpy
或
pip show numpy
更新numpy的版本
pip install --upgrade numpy
或
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade numpy
2、循环调用TensorFlow训练好的模型预测,语句saver = tf.train.Saver()出现如下错误:
NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Key Variable_10 not found in checkpoint
主要片段如下:
初步原因推测:计算图首次加载后,后面循环再次加载会出错。
解决:
1、循环体放在saver = tf.train.Saver()之后,这样就不会重复加载了。
2、通过重置等思路,但是还没有具体措施,再等进一步措施。