可以在Django项目中使用.h5文件吗?

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

can I use .h5 file in Django project?

问题

我正在使用Django和TensorFlow制作AI网页,并且我想知道如何在Django项目中添加.h5文件。

在views.py文件中编写整个代码
但我想使用预训练模型
而不是在网页上进行在线学习。

英文:

I'm making AI web page using Django and tensor flow. and I wonder how I add .h5 file in Django project.

writing whole code in views.py file
but I want to use pre-trained model
not online learning in webpage.

答案1

得分: 0

可以在Django中使用.h5文件。您可以使用h5py来处理.h5文件。示例 -

import h5py

filename = "filename.h5"

h5 = h5py.File(filename, 'r')

# 逻辑
...

h5.close()
英文:

Yeah u can use .h5 file in django. You can use h5py for operations on .h5 files. Exapmle -

import h5py

filename = "filename.h5"

h5 = h5py.File(filename,'r')

# logic
...

h5.close()

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

发表评论

匿名网友

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

确定