如何将OpenFOAM的C ++库从old-caffe2迁移到基于pytorch的caffe2?

问题描述

我有一个(Pytorch-> onnx-> caffe2)神经网络,我想将其用于OpenFOAM CFD模拟。问题在于,c ++库是为“旧” caffe2设计的,而没有为基于Pytorch的Caffe2进行编译。如何使其运作?我不知道该怎么办...

reynolds.Net.C文件

$ ls
Trivedi_chatbot.class
$ java Trivedi_chatbot
Hi there! My name is Alexa Jr!
whats up
Roof or sky,depending on if you're in a building.
goodbye
Goodbye! See you soon!
$ java Trivedi_chatbot </dev/null
Hi there! My name is Alexa Jr!
Exception in thread "main" java.util.NoSuchElementException: No line found
    at java.base/java.util.Scanner.nextLine(Scanner.java:1651)
    at Trivedi_chatbot.main(Trivedi_chatbot.java:13)

一些错误和警告示例:

/home/aiskhak/anaconda3/pkgs/pytorch-nightly-cpu-1.2.0.dev20190731+cpu-py3.7_cpu_0/lib/python3.7/site-packages/torch/include/caffe2/core/observer。 h:103:16:警告:使用旧式强制转换[-Wold-style-cast] LOG(ERROR)

reynoldsNet.C:87:52:错误:没有匹配的函数调用“ caffe2 :: Tensor :: Tensor(,std :: vector&,caffe2 :: cpuContext *)” 自动inputTensor = Tensor({1,5},inputdata,&ctx); ^ /home/aiskhak/anaconda3/pkgs/pytorch-nightly-cpu-1.2.0.dev20190731+cpu-py3.7_cpu_0/lib/python3.7/site-packages/torch/include/caffe2/core/tensor.h:29 :3:注意:候选人需要2个参数,提供3个 reynoldsNet.C:101:62:错误:使用已删除功能“ caffe2 :: Tensor :: Tensor(const caffe2 :: Tensor&)” 自动outBlob = workSpace.GetBlob(“输出”)-> Get();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)