跑一下实验看看论文的效果,结果花费了两天的时间,记录一下无数踩坑过程。根据这个教程,绝对可以运行成功Train+Test
论文名称:Rethinking the Image Fusion: A Fast Unified Image Fusion Network based on Proportional Maintenance of Gradient and Intensity
论文代码:Gitcode:PMGI
Github地址:https://github.com/HaoZhang1018/PMGI AAAI2020
第一部分,虚拟环境
因为服务器的CUDA是12.2的,所以已经不能用TensorFlow 1.x的版本
所以我的虚拟环境是TensorFlow2.12+Python 3.9.18
第二部分,修改代码
对于Tensorflow1.x的版本,在代码中将
import tensorflow as tf
修改为
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
这表示在2.x的版本中,使用Tensorflow1.x的版本屏蔽tf2的操作
然后这会解决绝大部分版本不兼容的问题,然后是一些小代码的修改
1.AttributeError: