我正在google的colab上训练机器学习模型。我正在使用keras和tensorflow后端(python 3.6)。
我正在使用keras提供的model.save()
函数保存我的模型。当我调用model.save('model_name
)`文件保存在哪里?我无法在任何地方找到它。
答案 0 :(得分:3)
首先,安装你的驱动器:
!mkdir -p drive
!google-drive-ocamlfuse drive
现在,追加你的路径:
import sys
sys.path.append('drive/Project')
您应该可以使用以下方式在本地和基于网络的驱动器上查看文件:
model.save('drive/Project/myModel.h5')
答案 1 :(得分:0)
即使为时已晚,我也遇到了同样的问题。然后我发现将驱动器装入colab,然后提供驱动器路径,文件将存储在google驱动器中
from google.colab import drive
drive.mount('/content/gdrive')
#using model.save_weights() to save the weights of the model in HDF5 format
model.save_weights("/content/gdrive/My Drive/weights.h5")
文件以名称“ weights.h5”保存在驱动器中