如何从Web应用程序(Django框架)读取Keras模型?用于模型读取的Python代码是:
pd.HDFStore('./pathtofile", mode = 'r')
从Django应用程序中,我需要根据用户选择的文件发送pathtofile变量。
Django代码无法传递路径:
def simple_upload(request):
if request.method == 'POST' and request.FILES['myfile']:
myfile = request.FILES['myfile']
fs = FileSystemStorage()
filename = fs.save(myfile.name, myfile)
uploaded_file_url = fs.url(filename)
return render(request, 'core/simple_upload.html', {
'uploaded_file_url': uploaded_file_url
})
return render(request, 'core/simple_upload.html')
是否有关于最佳做法的建议,以使我的keras模型更易于通过网络浏览器访问?