matthewearl / deep-anpr

Using neural networks to build an automatic number plate recognition system
MIT License
1.84k stars 697 forks source link

Error running in train.py :Dst tensor is not initialized. #54

Open Tian14267 opened 7 years ago

Tian14267 commented 7 years ago

I'm trying to run ./train.py , but I get error. Did someone know how to fix it ?

Traceback (most recent call last): File "./train.py", line 266, in initial_weights=initial_weights) File "./train.py", line 228, in train sess.run(init) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 767, in run run_metadata_ptr) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 965, in _run feed_dict_string, options, run_metadata) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1015, in _do_run target_list, options, run_metadata) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1035, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InternalError: Dst tensor is not initialized. [[Node: zeros_12 = Const[dtype=DT_FLOAT, value=Tensor<type: float shape: [32768,2048] values: [0 0 0]...>, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]

Caused by op u'zeros_12', defined at: File "./train.py", line 266, in initial_weights=initial_weights) File "./train.py", line 175, in train train_step = tf.train.AdamOptimizer(learn_rate).minimize(loss) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/optimizer.py", line 295, in minimize name=name) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/optimizer.py", line 409, in apply_gradients self._create_slots(var_list) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/adam.py", line 119, in _create_slots self._zeros_slot(v, "m", self._name) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/optimizer.py", line 609, in _zeros_slot named_slots[var] = slot_creator.create_zeros_slot(var, op_name) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/slot_creator.py", line 121, in create_zeros_slot val = array_ops.zeros(primary.get_shape().as_list(), dtype=dtype) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1370, in zeros output = constant(zero, shape=shape, dtype=dtype, name=name) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 169, in constant attrs={"value": tensor_value, "dtype": dtype_value}, name=name).outputs[0] File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2395, in create_op original_op=self._default_original_op, op_def=op_def) File "/home/vrview/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1264, in init self._traceback = _extract_stack()

InternalError (see above for traceback): Dst tensor is not initialized. [[Node: zeros_12 = Const[dtype=DT_FLOAT, value=Tensor<type: float shape: [32768,2048] values: [0 0 0]...>, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]