python-3.x - 无法从 Heroku 项目中的 AWS S3 读取文件
问题描述
我已经在 Heroku 上部署了我的 python 电报机器人。机器人必须使用 Nemo ML 模型,因为我的模型太大了我通过这条指令将它存储在 AWS S3 上
我尝试通过 AWS 的链接读取模型:
import nemo.collections.asr as nemo_asr
quartznet=nemo_asr.models.EncDecCTCModel.restore_from(restore_path="http://s3.amazonaws.com/dataforgolosbot/QuartzNet15x5_golos.nemo")
但我收到了这个错误:
2021-07-14T14:41:02.019040+00:00 app[worker.1]: Traceback (most recent call last):
2021-07-14T14:41:02.019051+00:00 app[worker.1]: File "/app/main.py", line 4, in <module>
2021-07-14T14:41:02.019209+00:00 app[worker.1]: quartznet = nemo_asr.models.EncDecCTCModel.restore_from(restore_path="http://s3.amazonaws.com/dataforgolosbot/QuartzNet15x5_golos.nemo")
2021-07-14T14:41:02.019215+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/nemo/core/classes/modelPT.py", line 474, in restore_from
2021-07-14T14:41:02.019469+00:00 app[worker.1]: raise FileNotFoundError(f"Can't find {restore_path}")
2021-07-14T14:41:02.019528+00:00 app[worker.1]: FileNotFoundError: Can't find http://s3.amazonaws.com/dataforgolosbot/QuartzNet15x5_golos.nemo
2021-07-14T14:41:03.220793+00:00 heroku[worker.1]: Process exited with status 1
2021-07-14T14:41:03.350467+00:00 heroku[worker.1]: State changed from up to crashed
解决方案
推荐阅读
- node.js - 我应该在页面上的每个组件中调用 Axios,还是在每个组件的父页面上多次调用 Axios?
- javascript - JavaScript 显示的数学答案不正确
- signalr - 通过 SignalR 将自定义类发送到 Blazor WebAssembly
- unit-testing - 检查单元测试 .net 核心 web api 中的模型状态内容
- android - 有没有办法同时在表格行内添加文本视图和按钮(使用 Android Java)
- c++ - 为什么在使用静态方法时取消引用 nullptr 而不是 C++ 中的未定义行为?
- php - in_array 无法检查 php 中的数组值
- javascript - json对象数组的长度
- python - 如何根据伯努利分布重新调整数据
- python - PyTorch DatasetLoader 张量应该是一个 Torch 张量。得到