论文及代码下载地址1
论文及代码下载地址2
论文及代码下载地址3
文章目录
-
-
- 一、代码
-
- Ⅰ、第一阶段 ImageAlignment代码调试
-
-
- 1、ModuleNotFoundError: No module named 'tensorflow.contrib'
- 2、IndexError: list index out of range
- 3、ValueError: The passed save_path is not a valid checkpoint: ./checkpoints_homo\model.ckpt-1050000
- 4、Resource exhausted: OOM when allocating tensor with shape[4,48,48,128] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cp 资源耗尽
- 5、AttributeError: module 'skimage' has no attribute 'measure'
- 6、IndexError: list index out of range
-
- Ⅱ、第二阶段ImageReconstruction代码调试
-
一、代码
Ⅰ、第一阶段 ImageAlignment代码调试
1、ModuleNotFoundError: No module named ‘tensorflow.contrib’
出错程序: H_model.py
出错原因:
出现这个错的原因主要是由于tensorflow的版本引起的,tensorflow.contrib 包是存在于tensorflow 1.x 版本中的,在tensorflow 2.x 版本中,已经没有tensorflow.contrib 包了,所以会报错。
解决方法:
只需要重新安装tensorflow 1.x 版本就可以了,附上如何在Anaconda中配置tensorflow的教程——安装教程
如果你不想再重新安装一遍,那么就去找方法,看能不能不降低版本解决吧!
2、IndexError: list index out of range
出错程序: utils.py
出错原因:
一般在python程序中出现“list index out of range”的错,主要有两种原因:
- 超出了list的范围
比如,list=(0,1,2),但是使用的时候错误的调用了list[4],就会出现索引超出范围的错; - list为空,在这种情况下使用list[0]便会报错;
解决方法:
经过添加测试程序,发现本文的代码出错原因应该是属于上述两种情况中的第二种,list为空,但是却错误的使用了list[0],因此出现错误。
# 测试代码,位于utils.py 的DataLoader类中
# ============================== 索引为空 &