iamaaditya / image-compression-cnn

Semantic JPEG image compression using deep convolutional neural network (CNN)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when train

JingjingZhangAndPan opened this issue · comments

Hello,

  1. when I train the owner model, I got an error such as below:
    DataLossError (see above for traceback): Unable to open table file models/model_0630.data-00000-of-00001: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

and I have modify params.py file like below:

self.num_epochs = 1 ##200
self.batch_size = 64 #32
self.max_iters = 2 ## 200000
self.test_every_iter = 10 ##200

and after the train operation success finished,
model.data-00000-of-00001 has been generated in models folder,
would you like to share me where is error?

  1. if I want train the model with pb format, is it possible?
    I changed the train.py file such as below:
    output_graph_def = convert_variables_to_constants(sess, sess.graph_def, ["output"])
    with tf.gfile.FastGFile("models\model.pb", "wb") as f:
    f.write(output_graph_def.SerializeToString())

but it has error such as:
File "train_hj.py", line 113, in
output_graph_def = convert_variables_to_constants(sess, sess.graph_def, ["class"])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/graph_util_impl.py", line 202, in convert_variables_to_constants
inference_graph = extract_sub_graph(input_graph_def, output_node_names)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/graph_util_impl.py", line 141, in extract_sub_graph
assert d in name_to_node_map, "%s is not in graph" % d
AssertionError: class is not in graph

would you like to point out where is error?
thanks.