noreward-rl icon indicating copy to clipboard operation
noreward-rl copied to clipboard

Error when restoring model

Open thumbe12856 opened this issue 7 years ago • 1 comments

After training the model for 1 day, I found that there was no meta graph file, so I couldn't restore it in src/demo.py. So I modified the src/worker.py:23, in the class of FastSave(), from super(FastSaver, self).save(sess, save_path, ..., False), to super(FastSaver, self).save(sess, save_path, ... , True). And this did create the meta graph file.

But when I used the demo.py to restore it, I got the error:

InvalidArgumentError (see above for traceback): Cannot assign a device for operation 'global/predictor/flast/b/Adam_1': Operation was explicitly assigned to /job:ps/task:0/device:CPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.
	 [[Node: global/predictor/flast/b/Adam_1 = VariableV2[_class=["loc:@global/predictor/flast/b"], container="", dtype=DT_FLOAT, shape=[288], shared_name="", _device="/job:ps/task:0/device:CPU:0"]()]]

Why the meta graph was explicitly assigned the operation to /job:ps/task:0/device:CPU:0 ? And what can I do to solve it?

thumbe12856 avatar Jun 20 '18 08:06 thumbe12856

Hello, I spent some days with same issue, but I found out that demo.py is not the correct one to see trained behavior of the model. You could restore trained parameters and run test scenarios by using inference.py.

leeswon avatar Nov 30 '18 19:11 leeswon