allenai/bilm-tf

Out of range: Read fewer bytes than requested

mohsen7394 opened this issue · 0 comments

I trained model but I cant load the saved model for dumping weights.
here is the error:
Restoring parameters from C:/Users/ASUS/Desktop/elmo/model\1455180model.ckpt-1455180
2019-11-25 01:16:01.448714: W tensorflow/core/framework/op_kernel.cc:1502] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Out of range: Read fewer bytes than requested
Traceback (most recent call last):
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1356, in _do_call
return fn(*args)
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read fewer bytes than requested
[[{{node lm/save/RestoreV2}}]]
[[lm/save/RestoreV2/_35]]
(1) Out of range: Read fewer bytes than requested
[[{{node lm/save/RestoreV2}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/ASUS/Desktop/elmo/bin/dump_weights.py", line 14, in
dw(args.save_dir, args.outfile)
File "C:\Users\ASUS\Desktop\elmo\bilm\training.py", line 1118, in dump_weights
loader.restore(sess, ckpt_file)
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1286, in restore
{self.saver_def.filename_tensor_name: save_path})
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 950, in run
run_metadata_ptr)
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _do_run
run_metadata)
File "C:\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: Read fewer bytes than requested
[[node lm/save/RestoreV2 (defined at \Users\ASUS\Desktop\elmo\bilm\training.py:1117) ]]
[[lm/save/RestoreV2/_35]]
(1) Out of range: Read fewer bytes than requested
[[node lm/save/RestoreV2 (defined at \Users\ASUS\Desktop\elmo\bilm\training.py:1117) ]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'lm/save/RestoreV2':
File "/Users/ASUS/Desktop/elmo/bin/dump_weights.py", line 14, in
dw(args.save_dir, args.outfile)
File "\Users\ASUS\Desktop\elmo\bilm\training.py", line 1117, in dump_weights
loader = tf.train.Saver()
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 825, in init
self.build()
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 837, in build
self._build(self._filename, build_save=True, build_restore=True)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 875, in _build
build_restore=build_restore)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 508, in _build_internal
restore_sequentially, reshape)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 328, in _AddRestoreOps
restore_sequentially)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 575, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1696, in restore_v2
name=name)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "\Users\ASUS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2005, in init
self._traceback = tf_stack.extract_stack()

Process finished with exit code 1