我是TensorFlow世界的新手,所以请耐心等待。
我目前使用的是M1 MacBook Pro,并按照以下说明使用Conda安装TensorFlow:https://towardsdatascience.com/installing-tensorflow-on-the-m1-mac-410bb36b776
所有代码在Jupyter笔记本上运行良好,直到我尝试适应模型:
initial_epochs = 5
history = model.fit(train_dataset, validation_data=validation_dataset, epochs=initial_epochs)
然而,在第一个epoch上对2175/2176个训练示例进行训练后,总是会出现一个弹出窗口,指出内核已经失效,必须重新启动。作为参考,以下是弹出之前的输出:
Epoch 1/5
WARNING:tensorflow:AutoGraph could not transform <function Model.make_train_function.<locals>.train_function at 0x17934f040> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
Cause: unsupported operand type(s) for -: 'NoneType' and 'int'
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
WARNING: AutoGraph could not transform <function Model.make_train_function.<locals>.train_function at 0x17934f040> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
Cause: unsupported operand type(s) for -: 'NoneType' and 'int'
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
2175/2176 [============================>.] - ETA: 0s - loss: 1.6207 - accuracy: 0.5527
我真的很感谢在这方面的任何帮助,因为我已经在这方面挣扎了一段时间了!
谢谢。
您可以使用Runtime-Change runtime type-Hardware Accelerator
中提供的GPU加速器进行检查。根据您拥有的数据集的大小,您可能需要考虑Colab Pro或TPU。
--以下是21年7月15日更新的
我之前的回答是关于科拉布的,很抱歉我错过了这个话题。对于Jupyter Notebook,应该有一个可以重新启动死内核的面板。