python tensorflow踩坑记录

问题

model.fit错误

输入shape检查过,是对的

Traceback (most recent call last):
  File "main.py", line 136, in 
    results = model.predict(testImageSet, verbose=1)
  File ".../lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/home/luosj/.local/lib/python3.8/site-packages/keras/engine/input_spec.py", line 216, in assert_input_compatibility
    raise ValueError(
ValueError: Layer "model" expects 1 input(s), but it received 38 input tensors. Inputs received: [

解决

输入不能为list,改为numpy.array

参考

python - ValueError: Layer sequential expects 1 inputs, but it received 211 input tensors in tensorflow 2.0 - Stack Overflow

你可能感兴趣的:(python边写边学,python,tensorflow,深度学习)