1.conv2d_v2() got an unexpected keyword argument ‘filter’
把filter改成filters
2.tf.placeholder() is not compatible with eager execution
在文件前面加:
tf.compat.v1.disable_eager_execution()
3.TypeError: dropout_v2() got an unexpected keyword argument ‘keep_prob’
将属性keep_prob改为rate
4.AttributeError: module ‘tensorflow._api.v2.train’ has no attribute ‘AdamOptimizer’
optimizer = tf.train.AdamOptimizer改为tf.optimizers.Adam()
5.ValueError: tape
is required when a Tensor
loss is passed.
问题意思是:传了loss参数,就得传tape,所以代码修改为:
6.RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device(‘cpu’) to map your storages to the CPU.
把出错的这一句
model_class.load_state_dict(torch.load(classes_weights_path))
改为
model.load_state_dict(torch.load(opt.weights_path,map_location=‘cpu’))