Justin-Tan / generative-compression

TensorFlow Implementation of Generative Adversarial Networks for Extreme Learned Image Compression
MIT License
511 stars 108 forks source link

Cannot use Pre-trained model properly #6

Closed sihuiluo closed 5 years ago

sihuiluo commented 6 years ago

Hello, there. I follow the readme instructions, import config_test from config, but still can't apply the checkpoint properly to compress a single image, could you please help? My env: tensorflow 1.8, python3.6.4

The error log is as follows: Traceback (most recent call last): File "compress.py", line 84, in main() File "compress.py", line 81, in main single_compress(config_test, args) File "compress.py", line 53, in single_compress new_saver.restore(sess, args.restore_path) File "/home/disk1/lsh/anaconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1802, in restore {self.saver_def.filename_tensor_name: save_path}) File "/home/disk1/lsh/anaconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr) File "/home/disk1/lsh/anaconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "/home/disk1/lsh/anaconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run run_metadata) File "/home/disk1/lsh/anaconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Key generator/noise_generator/conv_out/conv2d/bias not found in checkpoint [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_INT32, DT_INT32, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT _FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Justin-Tan commented 6 years ago

Did you pull the latest changes? Which checkpoint are you using, and what is in your config.py?

zhiqiang-zhu commented 6 years ago

I download the pretrained model(Noise sampling model), but there is no checkpoint file.