- 1.错误之处
- 2.原因与解决
tensorflow.python.framework.errors_impl.InvalidArgumentError: logits and labels must be broadcastable: logits_size=[8,1000] labels_size=[8,2]
[[node categorical_crossentropy/softmax_cross_entropy_with_logits (defined at /conda_3/PyCharm/Transer_Learning/DCR/InceptionV1手动搭建.py:238) ]] [Op:__inference_train_function_5688]
Function call stack:
train_function
2022-04-19 21:36:17.931892: W tensorflow/core/kernels/data/generator_dataset_op.cc:107] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated.
[[{{node PyFunc}}]]
训练的图像类别是2类:
而我的模型给出的是1000个类别,所以改成训练的图像类别数,即可。



