不能动
kennyfs opened this issue · 2 comments
系统是ubuntu18.04
以下是错误讯息:
(venv) kenny@wade-X750JB:~/Desktop/cchess-zero$ python main.py --mode play --ai_count 2 --ai_function mcts --play_playout 1200
Loading Models...
2018-08-29 15:55:02.524177: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
WARNING:tensorflow:From /home/kenny/Desktop/cchess-zero/policy_value_network.py:78: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.
See @{tf.nn.softmax_cross_entropy_with_logits_v2}.
Traceback (most recent call last):
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1278, in _do_call
return fn(*args)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1263, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [1] rhs shape= [128]
[[Node: save/Assign_66 = Assign[T=DT_FLOAT, _class=["loc:@conv2d_16/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_16/bias, save/RestoreV2:66)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1725, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 877, in run
run_metadata_ptr)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1100, in _run
feed_dict_tensor, options, run_metadata)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1272, in _do_run
run_metadata)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1291, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [1] rhs shape= [128]
[[Node: save/Assign_66 = Assign[T=DT_FLOAT, _class=["loc:@conv2d_16/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_16/bias, save/RestoreV2:66)]]
Caused by op 'save/Assign_66', defined at:
File "main.py", line 1583, in
args.search_threads, args.processor, args.num_gpus, args.res_block_nums, args.human_color) # * args.num_gpus
File "/home/kenny/Desktop/cchess-zero/ChessGame.py", line 50, in init
processor=processor, num_gpus=num_gpus, res_block_nums=res_block_nums, human_color=human_color)
File "/home/kenny/Desktop/cchess-zero/main.py", line 1142, in init
self.policy_value_netowrk = policy_value_network(res_block_nums) if processor == 'cpu' else policy_value_network_gpus(num_gpus, res_block_nums)
File "/home/kenny/Desktop/cchess-zero/policy_value_network.py", line 148, in init
self.saver = tf.train.Saver()
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1281, in init
self.build()
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1293, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1330, in _build
build_save=build_save, build_restore=build_restore)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 778, in _build_internal
restore_sequentially, reshape)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 419, in _AddRestoreOps
assign_ops.append(saveable.restore(saveable_tensors, shapes))
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 112, in restore
self.op.get_shape().is_fully_defined())
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/ops/state_ops.py", line 216, in assign
validate_shape=validate_shape)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign
use_locking=use_locking, name=name)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3155, in create_op
op_def=op_def)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [1] rhs shape= [128]
[[Node: save/Assign_66 = Assign[T=DT_FLOAT, _class=["loc:@conv2d_16/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_16/bias, save/RestoreV2:66)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 1583, in
args.search_threads, args.processor, args.num_gpus, args.res_block_nums, args.human_color) # * args.num_gpus
File "/home/kenny/Desktop/cchess-zero/ChessGame.py", line 50, in init
processor=processor, num_gpus=num_gpus, res_block_nums=res_block_nums, human_color=human_color)
File "/home/kenny/Desktop/cchess-zero/main.py", line 1142, in init
self.policy_value_netowrk = policy_value_network(res_block_nums) if processor == 'cpu' else policy_value_network_gpus(num_gpus, res_block_nums)
File "/home/kenny/Desktop/cchess-zero/policy_value_network.py", line 149, in init
self.train_restore()
File "/home/kenny/Desktop/cchess-zero/policy_value_network.py", line 170, in train_restore
self.saver.restore(self.sess, tf.train.latest_checkpoint(self.save_dir))
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1759, in restore
err, "a mismatch between the current graph and the graph")
tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Assign requires shapes of both tensors to match. lhs shape= [1] rhs shape= [128]
[[Node: save/Assign_66 = Assign[T=DT_FLOAT, _class=["loc:@conv2d_16/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_16/bias, save/RestoreV2:66)]]
Caused by op 'save/Assign_66', defined at:
File "main.py", line 1583, in
args.search_threads, args.processor, args.num_gpus, args.res_block_nums, args.human_color) # * args.num_gpus
File "/home/kenny/Desktop/cchess-zero/ChessGame.py", line 50, in init
processor=processor, num_gpus=num_gpus, res_block_nums=res_block_nums, human_color=human_color)
File "/home/kenny/Desktop/cchess-zero/main.py", line 1142, in init
self.policy_value_netowrk = policy_value_network(res_block_nums) if processor == 'cpu' else policy_value_network_gpus(num_gpus, res_block_nums)
File "/home/kenny/Desktop/cchess-zero/policy_value_network.py", line 148, in init
self.saver = tf.train.Saver()
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1281, in init
self.build()
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1293, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1330, in _build
build_save=build_save, build_restore=build_restore)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 778, in _build_internal
restore_sequentially, reshape)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 419, in _AddRestoreOps
assign_ops.append(saveable.restore(saveable_tensors, shapes))
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 112, in restore
self.op.get_shape().is_fully_defined())
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/ops/state_ops.py", line 216, in assign
validate_shape=validate_shape)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign
use_locking=use_locking, name=name)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3155, in create_op
op_def=op_def)
File "/home/kenny/tensorflow/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Assign requires shapes of both tensors to match. lhs shape= [1] rhs shape= [128]
[[Node: save/Assign_66 = Assign[T=DT_FLOAT, _class=["loc:@conv2d_16/bias"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](conv2d_16/bias, save/RestoreV2:66)]]
(venv) kenny@wade-X750JB:~/Desktop/cchess-zero$
你用的是tensorflow多少版本的?