Toybrick

pt转换问题 是环境原因吗

1105060120

注册会员

积分
171
楼主
发表于 2020-10-13 15:59:55    查看: 5855|回复: 4 | [复制链接]    打印 | 只看该作者
terminate called after throwing an instance of 'c10::Error'
  what():  [enforce fail at inline_container.cc:127] . PytorchStreamReader failed closing reader: file not found
frame #0: std::function<std::string ()>:perator()() const + 0x11 (0x7f91e3906fe1 in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: c10::ThrowEnforceNotMet(char const*, int, char const*, std::string const&, void const*) + 0x49 (0x7f91e3906c29 in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #2: torch::jit:yTorchStreamReader::valid(char const*) + 0x80 (0x7f91463b3650 in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libcaffe2.so)
frame #3: torch::jit:yTorchStreamReader::~PyTorchStreamReader() + 0x1f (0x7f91463b36ff in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libcaffe2.so)
frame #4: <unknown function> + 0x67a541 (0x7f91dc267541 in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libtorch.so.1)
frame #5: torch::jit::import_ir_module(std::function<std::shared_ptr<torch::jit::script::Module> (std::vector<std::string, std::allocator<std::string> > const&)>, std::string const&, c10:ptional<c10:evice>) + 0x15a (0x7f91dc26a2ca in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libtorch.so.1)
frame #6: <unknown function> + 0x3a55a1 (0x7f91e9f485a1 in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #7: <unknown function> + 0x116fac (0x7f91e9cb9fac in /home/lix/.local/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #8: python3() [0x50a7f5]
<omitting python frames>
frame #10: python3() [0x507f24]
frame #11: python3() [0x509c50]
frame #12: python3() [0x50a64d]
frame #14: python3() [0x509918]
frame #15: python3() [0x50a64d]
frame #17: python3() [0x507f24]
frame #19: python3() [0x634dd2]
frame #24: __libc_start_main + 0xe7 (0x7f9235342b97 in /lib/x86_64-linux-gnu/libc.so.6)

Aborted (core dumped)
回复

使用道具 举报

jefferyzhang

版主

积分
12975
沙发
发表于 2020-10-14 08:33:10 | 只看该作者
核对下pt版本,目前只支持1.2.0。
然后可以加置顶帖的qq群讨论下
回复

使用道具 举报

1105060120

注册会员

积分
171
板凳
 楼主| 发表于 2020-10-14 22:34:26 | 只看该作者
Traceback (most recent call last):
  File "synthesis.py", line 67, in <module>
    model, words, alpha=alpha)
  File "synthesis.py", line 47, in synthesis
    traced_script_module.save("c_fastspeech_model.pt")
RuntimeError:
could not export python function call Scatter. Remove calls to python functions before export.:
回复

使用道具 举报

1105060120

注册会员

积分
171
地板
 楼主| 发表于 2020-10-14 22:35:01 | 只看该作者
Traceback (most recent call last):
  File "test2.py", line 11, in <module>
    torch.load('c_fastspeech_model.pt')
  File "/home/lix/.local/lib/python3.6/site-packages/torch/serialization.py", line 367, in load
    return _load(f, map_location, pickle_module)
  File "/home/lix/.local/lib/python3.6/site-packages/torch/serialization.py", line 528, in _load
    magic_number = pickle_module.load(f)
_pickle.UnpicklingError: A load persistent id instruction was encountered,
but no persistent_load function was specified.
回复

使用道具 举报

1105060120

注册会员

积分
171
5#
 楼主| 发表于 2020-10-14 22:35:26 | 只看该作者
pt文件能转,但是load的时候有问题,是因为没转成功吗
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表