Traceback (most recent call last):
File "d:\Python\作业\Tensorflow代码\class6\p15_rnn_onehot_1pre1.py", line 47, in <module>
history = model.fit(x_train, y_train, batch_size=32, epochs=100, callbacks=[cp_callback])
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 728, in fit
use_multiprocessing=use_multiprocessing)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 224, in fit
distribution_strategy=strategy)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 547, in _process_training_inputs
use_multiprocessing=use_multiprocessing)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 594, in _process_inputs
steps=steps)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 2433, in _standardize_user_data
self._compile_from_inputs(all_inputs, y_input, x, y)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 2668, in _compile_from_inputs
experimental_run_tf_function=self._experimental_run_tf_function)
File "E:\Python\lib\site-packages\tensorflow_core\python\training\tracking\base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 343, in compile
endpoint.create_training_target(t, run_eagerly=self.run_eagerly)
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 3038, in create_training_target
self.loss_fn, K.dtype(self.output))
File "E:\Python\lib\site-packages\tensorflow_core\python\keras\backend.py", line 1249, in dtype
return x.dtype.base_dtype.name
AttributeError: 'NoneType' object has no attribute 'dtype'
曹建老师的LSTM预测股票的源代码在我的电脑上运行报错,是怎么回事呀?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
5条回答 默认 最新
CSDN专家-赖老师(软件之家) 2021-04-15 20:56关注'NoneType' object has no attribute 'dtype',没有dtype属性,是不是版本问题呢?
评论 打赏 举报解决 1无用 1