tobegit3hub/deep_image_model

questions about pokemon_classifer

yinmengxia opened this issue · 5 comments

when I Run the program pokemon,there are some questions as follows,but I do not know what is the meaning and how to modify,

Traceback (most recent call last):
File "E:/Python/TEST2.0/pokemon_classifer.py", line 391, in
main()
File "E:/Python/TEST2.0/pokemon_classifer.py", line 354, in main
tf.constant(FLAGS.export_version), sess)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\contrib\session_bundle\exporter.py", line 269, in export
gfile.MakeDirs(tmp_export_dir)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 299, in recursive_create_dir
pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)
File "D:\Program Files\Anaconda3\lib\contextlib.py", line 66, in exit
next(self.gen)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./model\00000001-tmp

Thank you!

The error is "Failed to create a directory". You can comment out the 354th line of code to export the model.

The exporter may not work for Windows, you can just not export the model now.

Thank you very much!
I learned there are different types of net models,when I run the program,it just uses the cnn model and adam optimizer,I do not know how to use other models.Next,I also don't know the meaning of the dataset 'inference'.There are some results of the program:
"D:\Program Files\Anaconda3\python.exe" E:/Python/TEST0/geshizhuanhua.py
Start Pokemon classifier
Use the model: cnn
Use the optimizer: adam
Use the model: cnn
WARNING:tensorflow:From E:/Python/TEST0/geshizhuanhua.py:297 in main.: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use tf.global_variables_initializer instead.
Continue training from the model ./checkpoint/checkpoint.ckpt-170
[0:00:00.985056] Epoch: 0, loss: 0.19509480893611908, train_accuracy: 1.0, test_accuracy: 0.05882352963089943
[0:00:02.539145] Epoch: 1, loss: 0.0, train_accuracy: 0.9984520077705383, test_accuracy: 0.05882352963089943
[0:00:02.744157] Epoch: 2, loss: 0.13220781087875366, train_accuracy: 1.0, test_accuracy: 0.05882352963089943
[0:00:02.077119] Epoch: 3, loss: 0.0, train_accuracy: 1.0, test_accuracy: 0.05882352963089943
[0:00:01.932110] Epoch: 4, loss: 0.0, train_accuracy: 1.0, test_accuracy: 0.05882352963089943
Exporting trained model to ./model
Done exporting!
End of Pokemon classifier

Great!

Thank you!
I don't know your meaning.
I try to change 'cnn' to 'lstm' in
flags.DEFINE_string(
"model", "lstm",
"Model to train, option model: cnn, lstm, bidirectional_lstm, stacked_lstm")
but there are much more problems,is there any problem with Windows?

"D:\Program Files\Anaconda3\python.exe" E:/Python/TEST2.0/pokemon_classifer.py
Start Pokemon classifier
Use the model: cnn
Use the optimizer: adam
Use the model: cnn
WARNING:tensorflow:From E:/Python/TEST2.0/pokemon_classifer.py:297 in main.: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use tf.global_variables_initializer instead.
Continue training from the model ./checkpoint/checkpoint.ckpt-20
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key beta1_power not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key beta2_power not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key fc1/bias/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key fc1/weights/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key fc1/bias/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key fc1/weights/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv1/bias/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv1/bias/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv1/weights/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv2/weights/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv1/weights/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv2/bias/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv2/weights/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key conv2/bias/Adam_1 not found in checkpoint
Traceback (most recent call last):
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1021, in _do_call
return fn(*args)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1003, in _run_fn
status, run_metadata)
File "D:\Program Files\Anaconda3\lib\contextlib.py", line 66, in exit
next(self.gen)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Key beta1_power not found in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:/Python/TEST2.0/pokemon_classifer.py", line 387, in
main()
File "E:/Python/TEST2.0/pokemon_classifer.py", line 310, in main
saver.restore(sess, ckpt.model_checkpoint_path)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1388, in restore
{self.saver_def.filename_tensor_name: save_path})
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 766, in run
run_metadata_ptr)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 964, in _run
feed_dict_string, options, run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1014, in _do_run
target_list, options, run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1034, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key beta1_power not found in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op 'save/RestoreV2', defined at:
File "E:/Python/TEST2.0/pokemon_classifer.py", line 387, in
main()
File "E:/Python/TEST2.0/pokemon_classifer.py", line 295, in main
saver = tf.train.Saver()
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1000, in init
self.build()
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1030, in build
restore_sequentially=self._restore_sequentially)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 624, in build
restore_sequentially, reshape)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 361, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 200, in restore_op
[spec.tensor.dtype])[0])
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 441, in restore_v2
dtypes=dtypes, name=name)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 759, in apply_op
op_def=op_def)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1128, in init
self._traceback = _extract_stack()

NotFoundError (see above for traceback): Key beta1_power not found in checkpoint
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

If It can work well for Linux?
I don't know how operate whole program and I have no idea.

The error is as follow:
"D:\Program Files\Anaconda3\python.exe" E:/Python/TEST2.0/pokemon_classifer.py
Start Pokemon classifier
Use the model: lstm
Use the optimizer: adam
Use the model: lstm
WARNING:tensorflow:From E:/Python/TEST2.0/pokemon_classifer.py:297 in main.: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use tf.global_variables_initializer instead.
Continue training from the model ./checkpoint/checkpoint.ckpt-20
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key RNN/BasicLSTMCell/Linear/Bias/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key RNN/BasicLSTMCell/Linear/Bias not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key RNN/BasicLSTMCell/Linear/Bias/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key RNN/BasicLSTMCell/Linear/Matrix not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key beta2_power not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key RNN/BasicLSTMCell/Linear/Matrix/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key RNN/BasicLSTMCell/Linear/Matrix/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key beta1_power not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable_3 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable_1/Adam not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable_1/Adam_1 not found in checkpoint
W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:975] Not found: Key Variable_2 not found in checkpoint
Traceback (most recent call last):
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1021, in _do_call
return fn(*args)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1003, in _run_fn
status, run_metadata)
File "D:\Program Files\Anaconda3\lib\contextlib.py", line 66, in exit
next(self.gen)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Key RNN/BasicLSTMCell/Linear/Bias/Adam not found in checkpoint
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:/Python/TEST2.0/pokemon_classifer.py", line 387, in
main()
File "E:/Python/TEST2.0/pokemon_classifer.py", line 310, in main
saver.restore(sess, ckpt.model_checkpoint_path)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1388, in restore
{self.saver_def.filename_tensor_name: save_path})
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 766, in run
run_metadata_ptr)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 964, in _run
feed_dict_string, options, run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1014, in _do_run
target_list, options, run_metadata)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1034, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key RNN/BasicLSTMCell/Linear/Bias/Adam not found in checkpoint
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

Caused by op 'save/RestoreV2_1', defined at:
File "E:/Python/TEST2.0/pokemon_classifer.py", line 387, in
main()
File "E:/Python/TEST2.0/pokemon_classifer.py", line 295, in main
saver = tf.train.Saver()
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1000, in init
self.build()
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1030, in build
restore_sequentially=self._restore_sequentially)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 624, in build
restore_sequentially, reshape)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 361, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 200, in restore_op
[spec.tensor.dtype])[0])
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 441, in restore_v2
dtypes=dtypes, name=name)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 759, in apply_op
op_def=op_def)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1128, in init
self._traceback = _extract_stack()

NotFoundError (see above for traceback): Key RNN/BasicLSTMCell/Linear/Bias/Adam not found in checkpoint
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save/Const_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

Process finished with exit code 1