这里记录论文END-TO-END OPTIMIZED IMAGE COMPRESSION相关代码报错的记录(我这里运行的tensorflow1.15版本对应的代码)
github:https://github.com/tensorflow/compression
1、cuda设备问题
tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid device ordinal value (1). Valid range is [0, 0].
while setting up XLA_GPU_JIT device number 1
解决方法
最后在命令前面加上CUDA_VISIBLE_DEVICE:
CUDA_VISIBLE_DEVICES=0 python bls2017.py --verbose train --train_glob="/home/ll/END-TO-END-OPTIMIZED-IMAGE-COMPRESSION/image/*JPEG"
或者在代码中加入
import os
os.environ['CUDA_VISIBLE_DEVICES']='0'
2、
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __inference_Dataset_map_<lambda>_122}} assertion failed: [Need value.shape >= size, got ] [230 170 3] [256 256 3]
[[{{node random_crop/Assert/Assert}}]]
[[IteratorGetNext]]