英文:
The Python kernel is unresponsive.The Python process exited with exit code 139 (SIGSEGV: Segmentation fault)
问题
custom_vgg_model.save("/dbfs/FileStore/output/trained_model/my3_trained.h5")
当我在Databricks上运行这个命令时,内核崩溃了。但是去掉'.h5'之后就可以正常工作了。
我原本期望训练好的模型被保存在文件存储中。
英文:
custom_vgg_model.save("/dbfs/FileStore/output/trained_model/my3_trained.h5")
when i ran this in databricks ,kernel crashed.But without '.h5' it worked.
I was expecting the trained model saved in filestore
答案1
得分: 0
在将其保存到DBFS时,我也遇到了相同的错误。
遵循以下步骤。
将模型保存到本地文件系统,然后在DBFS中加载它。
model.save('/tmp/my_models/my_model.h5')
将模型复制到DBFS。
dbutils.fs.cp("file:/tmp/my_models/my_model.h5","dbfs:/tmp/my_models/my_model.h5")
然后加载模型。
new_model = tf.keras.models.load_model('/tmp/my_models/my_model.h5')
new_model.summary()
英文:
Even I got the same error while saving it in dbfs.
So follow below approach.
Save the model to local filesystem and load it in dbfs.
model.save('/tmp/my_models/my_model.h5')
dbutils.fs.ls("file:/tmp/my_models/")
copy the model to dbfs.
dbutils.fs.cp("file:/tmp/my_models/my_model.h5","dbfs:/tmp/my_models/my_model.h5")
Then load the model.
new_model = tf.keras.models.load_model('/tmp/my_models/my_model.h5')
new_model.summary()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论