代码在Google Collab中运行,但不在本地计算机python上运行

时间:2020-09-18 17:12:20

标签: python python-3.x django tensorflow keras

我正在运行TensorFlow模型,当我尝试在google collab上运行它时,它运行良好,但是如果我在本地计算机上运行相同的代码,则会出现以下错误:

C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\callbacks.py:1472: RuntimeWarning: invalid value encountered in less
  if self.monitor_op(current - self.min_delta, self.best):
Traceback (most recent call last):
  File "lstm_var_1.py", line 363, in <module>
    callbacks=[es], steps_per_epoch= len(generator_train_var))
  File "C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\kerashypetune\kerashypetune.py", line 460, in search
    **all_fitargs)
  File "C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper
    return method(self, *args, **kwargs)
  File "C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\engine\training.py", line 876, in fit
    callbacks.on_epoch_end(epoch, epoch_logs)
  File "C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\callbacks.py", line 365, in on_epoch_end
    callback.on_epoch_end(epoch, logs)
  File "C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\callbacks.py", line 1485, in on_epoch_end
    self.model.set_weights(self.best_weights)
  File "C:\Users\Shaikh Abuzar\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1519, in set_weights
    if expected_num_weights != len(weights):
TypeError: object of type 'NoneType' has no len()

如果有人可以帮助我,那真的很棒。 https://colab.research.google.com/drive/1kQ2KeiSXEbLRJ3tooJ8A6-tg0oqmNBRR?usp=sharing

谢谢。

0 个答案:

没有答案