zoukankan      html  css  js  c++  java
  • 问题记录贴

    torch转onnx

    在转一个并不复杂的模型的时候出现错误.模型并不存在什么复杂的算子.

    RuntimeError: tuple appears in op that does not forward tuples (VisitNode at /pytorch/torch/csrc/jit/passes/lower_tuples.cpp:109)
    frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7f27f31b3fe1 in /home/train/.local/lib/python3.5/site-packages/torch/lib/libc10.so)
    frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x7f27f31b3dfa in /home/train/.local/lib/python3.5/site-packages/torch/lib/libc10.so)
    frame #2: <unknown function> + 0x6da2e1 (0x7f27def7f2e1 in /home/train/.local/lib/python3.5/site-packages/torch/lib/libtorch.so.1)
    frame #3: <unknown function> + 0x6da534 (0x7f27def7f534 in /home/train/.local/lib/python3.5/site-packages/torch/lib/libtorch.so.1)
    
    

    搜索后发现和这个错误类似.
    DataParallel移除即可.

    model = mobilenetv2()
    model = torch.nn.DataParallel(model).cuda()
    

    改为

    model = mobilenetv2().cuda()
    
  • 相关阅读:
    发送 GET 和 POST 请求
    日志记录帮助类
    常用正则表达式
    获取验证码
    C# 生成二维码
    android sql Cursor
    sql 语句操作
    android 界面悬浮框实现
    android activity四种启动模式
    andorid 自定义view属性declare-styleable
  • 原文地址:https://www.cnblogs.com/sdu20112013/p/13299118.html
Copyright © 2011-2022 走看看