Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vidyaprashant opened this issue Jan 23, 2019 · 3 comments

Comments

@vidyaprashant
Copy link

vidyaprashant commented Jan 23, 2019

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
Copy link
Owner

nejyeah commented Jan 28, 2019

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
Copy link
Author

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
Copy link
Owner

nejyeah commented Feb 20, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants