Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
548 views
in Technique[技术] by (71.8m points)

python - 找不到可以处理输入的数据适配器: <class 'numpy.ndarray'> ,( <class 'list'> 包含类型{ <class 'int'> ”})(Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {“<class 'int'>”}))

history = model.fit(X, y, batch_size=32, epochs=40, validation_split=0.1)

(历史= model.fit(X,y,batch_size = 32,epochs = 40,validation_split = 0.1))

the line problem was this

(线路问题是这个)

Showing error:

(显示错误:)

ValueError: Failed to find data adapter that can handle input: , ( containing values of types {""})

(ValueError:未能找到可以处理输入的数据适配器:(包含类型为““”}的值))

  ask by Neo translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

So this is happening the the newer version of tensorflow I'm not sure from where but I was on version 2.0.0 and this same thing happened

(所以这发生在新版本的tensorflow上,我不确定从哪里来,但我在2.0.0版本上,并且发生了同样的事情)

I'm assuming that you are only converting the X array into a numpy array But rather try converting 'X' as well as 'y' to numpy array using the dtype as np.uint8

(我假设您只是将X数组转换为numpy数组,而是尝试使用dtype作为np.uint8将'X'以及'y'转换为numpy数组)

That should resolve the problem

(那应该解决问题)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...