nejyeah / DeepPicker-python

This is the source code for the paper DeepPicker.
31 stars 21 forks source link

ValueError: Only call `sparse_softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...) #4

Open vidyaprashant opened 5 years ago

vidyaprashant commented 5 years ago

Hi, whenever I am trying to train my own model which has only three .mrc images using the following query it results in some errors please anyone help me with solution

(tfg) C:\Users\admin\Desktop\my deeppicker>python train.py --train_type 1 --train_inputDir "mrc" --particle_size 50 --mrc_number 3 --particle_number 3 --coordinate_symbol "_manual_checked" --model_save_dir "trained_model" --model_save_file "model_demo_type1" (0, 64, 64, 1) float64 (0,) int64 (0, 64, 64, 1) float64 (0,) int64 Load training data successfully! Traceback (most recent call last): File "train.py", line 176, in main() File "train.py", line 172, in main train() File "train.py", line 130, in train deepModel.init_model_graph_train() File "C:\Users\admin\Desktop\my deeppicker\deepModel.py", line 160, in init_model_graph_train self.loss_operation = self.loss(self.inference(self.train_data_node,train=True)) File "C:\Users\admin\Desktop\my deeppicker\deepModel.py", line 91, in __loss self.train_label_node, name = 'cross_entropy_all') File "C:\Users\admin\Anaconda3\envs\tfg\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2011, in sparse_softmax_cross_entropy_with_logits labels, logits) File "C:\Users\admin\Anaconda3\envs\tfg\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1759, in _ensure_xent_args "named arguments (labels=..., logits=..., ...)" % name) ValueError: Only call sparse_softmax_cross_entropy_with_logits with named arguments (labels=..., logits=..., ...)

nejyeah commented 5 years ago

Hi, this is caused by the version of Tensorflow. This code is based on an old version of Tensorflow. The new version have changed some functions like the one "sparse_softmax_cross_entropy_with_logits"

vidyaprashant commented 5 years ago

will you please help me with the which version of Tensorflow is suitable for the existing code or which function needs to be used instead of "sparse_softmax_cross_entropy_with_logits"

nejyeah commented 5 years ago

The versions of Tensorflow suitable for this code is too old to get. You may need to checkout the Tensorflow "sparse_softmax_cross_entropy_with_logits" API of the current version you use.