RishalAggarwal / 3D-Convnet-for-Alzheimer-s-Detection

3D brain image preprocessing and training (coded when I was a sophomore)
39 stars 19 forks source link

Uable to load checkpoints of trained data into the testing program.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? #1

Open jubittajohn opened 5 years ago

jubittajohn commented 5 years ago

ckpt='./trained_model1/model.tfl.ckpt-1250.data-00000-of-00001'

This code as mentioned was used to load thw checkpoint and showed the error below and didn't work properly.

2019-04-28 21:10:26.175413: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /home/jubitta/project/trained_model1/model.tfl.ckpt-1250.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? 2019-04-28 21:10:26.175769: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /home/jubitta/project/trained_model1/model.tfl.ckpt-1250.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? 2019-04-28 21:10:26.175791: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at save_restore_tensor.cc:175 : Data loss: Unable to open table file /home/jubitta/project/trained_model1/model.tfl.ckpt-1250.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? Traceback (most recent call last): File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call return fn(*args) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/jubitta/project/trained_model1/model.tfl.ckpt-1250.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_1/RestoreV2}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "testing.py", line 151, in model.load(ckpt)
File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tflearn/models/dnn.py", line 308, in load self.trainer.restore(model_file, weights_only, **optargs) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tflearn/helpers/trainer.py", line 490, in restore self.restorer.restore(self.session, model_file) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1276, in restore {self.saver_def.filename_tensor_name: save_path}) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run run_metadata_ptr) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _run feed_dict_tensor, options, run_metadata) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run run_metadata) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/jubitta/project/trained_model1/model.tfl.ckpt-1250.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_1/RestoreV2 (defined at /home/jubitta/anaconda3/lib/python3.6/site-packages/tflearn/helpers/trainer.py:147) ]]

Caused by op 'save_1/RestoreV2', defined at: File "testing.py", line 141, in model = tflearn.DNN(net, checkpoint_path = './tested_model1/model.tfl.ckpt',max_checkpoints=1) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tflearn/models/dnn.py", line 65, in init best_val_accuracy=best_val_accuracy) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tflearn/helpers/trainer.py", line 147, in init allow_empty=True) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 832, in init self.build() File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 844, in build self._build(self._filename, build_save=True, build_restore=True) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 881, in _build build_save=build_save, build_restore=build_restore) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal restore_sequentially, reshape) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 332, in _AddRestoreOps restore_sequentially) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 580, in bulk_restore return io_ops.restore_v2(filename_tensor, names, slices, dtypes) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1572, in restore_v2 name=name) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "/home/jubitta/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1801, in init self._traceback = tf_stack.extract_stack()

DataLossError (see above for traceback): Unable to open table file /home/jubitta/project/trained_model1/model.tfl.ckpt-1250.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_1/RestoreV2 (defined at /home/jubitta/anaconda3/lib/python3.6/site-packages/tflearn/helpers/trainer.py:147) ]]