when I tried to reproduce this model and input:
from word2vec import Word2Vec
word2vec5_9m = Word2Vec('5.9m')
w2v_runtime = word2vec5_9m.res
I got error information:
OutOfRangeError Traceback (most recent call last)
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _do_call(self, fn, *args)
1326 try:
-> 1327 return fn(*args)
1328 except errors.OpError as e:
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata)
1311 return self._call_tf_sessionrun(
-> 1312 options, feed_dict, fetch_list, target_list, run_metadata)
1313
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata)
1419 self._session, options, feed_dict, fetch_list, target_list,
-> 1420 status, run_metadata)
1421
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\framework\errors_impl.py in exit(self, type_arg, value_arg, traceback_arg)
515 compat.as_text(c_api.TF_Message(self.status.status)),
--> 516 c_api.TF_GetCode(self.status.status))
517 # Delete the underlying status object from memory otherwise it stays alive
OutOfRangeError: Read fewer bytes than requested
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, 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)]]
During handling of the above exception, another exception occurred:
OutOfRangeError Traceback (most recent call last)
in ()
2
3 word2vec5_9m = Word2Vec('5.9m')
----> 4 w2v_runtime = word2vec5_9m.restore_runtime()
~\patents-public-data\models\landscaping\word2vec.py in restore_runtime(self)
481 with tf.Session(graph=w2v_graph.train_graph, config=GPU_MEM_CONFIG) as sess:
482 saver = tf.train.Saver()
--> 483 saver.restore(sess, tf.train.latest_checkpoint(self.checkpoints_path))
484 embedding_weights, normed_embedding_weights =
485 sess.run([w2v_graph.embedding, w2v_graph.normalized_embedding])
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py in restore(self, sess, save_path)
1773 else:
1774 sess.run(self.saver_def.restore_op_name,
-> 1775 {self.saver_def.filename_tensor_name: save_path})
1776
1777 @staticmethod
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in run(self, fetches, feed_dict, options, run_metadata)
903 try:
904 result = self._run(None, fetches, feed_dict, options_ptr,
--> 905 run_metadata_ptr)
906 if run_metadata:
907 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
1138 if final_fetches or final_targets or (handle and feed_dict_tensor):
1139 results = self._do_run(handle, final_targets, final_fetches,
-> 1140 feed_dict_tensor, options, run_metadata)
1141 else:
1142 results = []
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
1319 if handle is None:
1320 return self._do_call(_run_fn, feeds, fetches, targets, options,
-> 1321 run_metadata)
1322 else:
1323 return self._do_call(_prun_fn, handle, feeds, fetches)
~\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _do_call(self, fn, *args)
1338 except KeyError:
1339 pass
-> 1340 raise type(e)(node_def, op, message)
1341
1342 def _extend_graph(self):
OutOfRangeError: Read fewer bytes than requested
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, 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)]]
Caused by op 'save/RestoreV2', defined at:
File "C:\Users\xyz\Miniconda3\envs\py35\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel_main.py", line 3, in
app.launch_new_instance()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
app.start()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel\kernelapp.py", line 486, in start
self.io_loop.start()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tornado\platform\asyncio.py", line 127, in start
self.asyncio_loop.run_forever()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\asyncio\base_events.py", line 1425, in _run_once
handle._run()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\asyncio\events.py", line 127, in _run
self._callback(*self._args)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tornado\platform\asyncio.py", line 117, in _handle_events
handler_func(fileobj, events)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tornado\stack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\zmq\eventloop\zmqstream.py", line 450, in _handle_events
self._handle_recv()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\zmq\eventloop\zmqstream.py", line 480, in _handle_recv
self._run_callback(callback, msg)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\zmq\eventloop\zmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tornado\stack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel\kernelbase.py", line 283, in dispatcher
return self.dispatch_shell(stream, msg)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel\kernelbase.py", line 233, in dispatch_shell
handler(stream, idents, msg)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel\kernelbase.py", line 399, in execute_request
user_expressions, allow_stdin)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel\ipkernel.py", line 208, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\ipykernel\zmqshell.py", line 537, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\IPython\core\interactiveshell.py", line 2662, in run_cell
raw_cell, store_history, silent, shell_futures)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\IPython\core\interactiveshell.py", line 2785, in _run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\IPython\core\interactiveshell.py", line 2903, in run_ast_nodes
if self.run_code(code, result):
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\IPython\core\interactiveshell.py", line 2963, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 4, in
w2v_runtime = word2vec5_9m.restore_runtime()
File "C:\Users\xyz\patents-public-data\models\landscaping\word2vec.py", line 482, in restore_runtime
saver = tf.train.Saver()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py", line 1311, in init
self.build()
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py", line 1320, in build
self._build(self._filename, build_save=True, build_restore=True)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py", line 1357, in _build
build_save=build_save, build_restore=build_restore)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py", line 809, in _build_internal
restore_sequentially, reshape)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py", line 448, in _AddRestoreOps
restore_sequentially)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\training\saver.py", line 860, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1457, in restore_v2
shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\framework\ops.py", line 3290, in create_op
op_def=op_def)
File "C:\Users\xyz\Miniconda3\envs\py35\lib\site-packages\tensorflow\python\framework\ops.py", line 1654, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
OutOfRangeError (see above for traceback): Read fewer bytes than requested
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, 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)]]
I don't know what's the problem since I followed all your instructions!