Python内核无响应。Python进程以退出代码139(SIGSEGV:分段错误)退出。

huangapple go评论40阅读模式
英文:

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'之后就可以正常工作了。

我原本期望训练好的模型被保存在文件存储中。

英文:

enter image description here

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.

Python内核无响应。Python进程以退出代码139(SIGSEGV:分段错误)退出。

So follow below approach.

Save the model to local filesystem and load it in dbfs.

model.save('/tmp/my_models/my_model.h5')

Python内核无响应。Python进程以退出代码139(SIGSEGV:分段错误)退出。

dbutils.fs.ls("file:/tmp/my_models/")

Python内核无响应。Python进程以退出代码139(SIGSEGV:分段错误)退出。

copy the model to dbfs.

dbutils.fs.cp("file:/tmp/my_models/my_model.h5","dbfs:/tmp/my_models/my_model.h5")

Python内核无响应。Python进程以退出代码139(SIGSEGV:分段错误)退出。

Then load the model.

new_model = tf.keras.models.load_model('/tmp/my_models/my_model.h5')
new_model.summary()

Python内核无响应。Python进程以退出代码139(SIGSEGV:分段错误)退出。

huangapple
  • 本文由 发表于 2023年6月6日 02:32:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76409133.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定