Comments (8)
@YuzhouPeng 可以的~ Forward 的 Plugins 目录中也有引入 TensorRT 官方的 embLayerNormPlugin 的。
from forward.
@yuanzexi 大佬,我还想请教下,embLayerNormPlugin 里面需要输入layernorm,word embedding,token embeddingg等参数,而且输入有三个,但是我keras使用embedding的时候只输入了一个32位数组,像这种情况embLayerNormPlugin 的那些参数该怎么设置比较好呢?
from forward.
@YuzhouPeng 对于 Keras.Embedding 的操作,我们是用 Gather 层实现的 https://github.com/Tencent/Forward/blob/master/source/fwd_keras/keras_cvt/keras_desc_creators/keras_gather_creator.h
你可以看看是否满足需求。如果你确实需要使用 EmbedLayerNorm plugin 来实现,你可以根据你自己的需求来设置那些输入和参数。
from forward.
@yuanzexi , when i build the demo/fwd_cpp
, it put the error:
[ 75%] Linking CXX executable test_fwd_engine
CMakeFiles/test_fwd_engine.dir/test_fwd_engine.cpp.o:在函数‘main’中:
test_fwd_engine.cpp:(.text+0x1c8):对‘fwd::TrtForwardEngine::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/test_fwd_engine.dir/build.make:91: recipe for target 'test_fwd_engine' failed
make[2]: *** [test_fwd_engine] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/test_fwd_engine.dir/all' failed
make[1]: *** [CMakeFiles/test_fwd_engine.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[100%] Linking CXX executable test_fwd_torch
CMakeFiles/test_fwd_torch.dir/test_fwd_torch.cpp.o:在函数‘main’中:
test_fwd_torch.cpp:(.text+0x85c):对‘fwd::TorchBuilder::SetInferMode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’未定义的引用
test_fwd_torch.cpp:(.text+0x9cf):对‘fwd::TorchBuilder::Build(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<c10::IValue, std::allocator<c10::IValue> > const&)’未定义的引用
test_fwd_torch.cpp:(.text+0xaa2):对‘fwd::TorchEngine::Save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const’未定义的引用
test_fwd_torch.cpp:(.text+0xaf4):对‘fwd::TorchEngine::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const’未定义的引用
../libs/libfwd_torch.so:对‘c10::Error::Error(c10::SourceLocation, std::string)’未定义的引用
../libs/libfwd_torch.so:对‘c10::detail::infer_schema::make_function_schema(std::string&&, std::string&&, c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>, c10::ArrayRef<c10::detail::infer_schema::ArgumentDef>)’未定义的引用
../libs/libfwd_torch.so:对‘c10::Symbol::fromQualString(std::string const&)’未定义的引用
../libs/libfwd_torch.so:对‘at::Tensor::toString() const’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::Object::find_method(std::string const&) const’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::SubgraphRewriter::runOnGraph(std::shared_ptr<torch::jit::Graph>&, std::vector<std::function<bool (torch::jit::Match const&, std::unordered_map<std::string, torch::jit::Value*, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, torch::jit::Value*> > > const&)>, std::allocator<std::function<bool (torch::jit::Match const&, std::unordered_map<std::string, torch::jit::Value*, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, torch::jit::Value*> > > const&)> > > const&)’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::SubgraphRewriter::RegisterRewritePattern(std::string const&, std::string const&)’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::Method::operator()(std::vector<c10::IValue, std::allocator<c10::IValue> >, std::unordered_map<std::string, c10::IValue, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, c10::IValue> > > const&)’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::Value::debugNameBase() const’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::parseSchemaOrName(std::string const&)’未定义的引用
../libs/libfwd_torch.so:对‘torch::jit::load(std::string const&, c10::optional<c10::Device>, std::unordered_map<std::string, std::string, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::string> > >&)’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/test_fwd_torch.dir/build.make:105: recipe for target 'test_fwd_torch' failed
make[2]: *** [test_fwd_torch] Error 1
CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/test_fwd_torch.dir/all' failed
make[1]: *** [CMakeFiles/test_fwd_torch.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
我已经切换几个tag了。提前谢谢了。
from forward.
Hello @chenjun2hao ,
我们刚测试了下,发现 build.sh
可以成功运行,推测可能是环境配置造成的错误。
希望你这边可以提供这些信息,以便我们做进一步判断。
-
提供修改后的
build.sh
文件内容 -
注释
build.sh
的最后一行make -j
,并运行build.sh
,提供脚本运行的结果
谢谢~
from forward.
@zhaoyiluo ,你好。动态库是可以编译出来的。但是用动态库编译demo下来的exe的时候报上面的错误。我用另外一台电脑测试,也出现同样的问题。
from forward.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
from forward.
This issue was closed because it has been stalled for 5 days with no activity.
from forward.
Related Issues (20)
- 使用这个Forward框架进行推断的时候会有精度损失吗? HOT 6
- 关于fwd-torch的几个路径的问题 HOT 2
- Segmentation fault (core dumped) when transfer keras model to trt. HOT 4
- Help to support tensorflow slim "Flatten" pattern to Tensorrt. HOT 10
- 编译VC项目时出错 HOT 14
- vs2017怎么跑demo? HOT 8
- Is have docker with all dependencies? HOT 3
- Will forward framework support paddlepaddle in the future? HOT 4
- win_python_keras版本加载模型时报错 HOT 4
- 编译出错 找不到cublas_device库 HOT 7
- Keras中Flatten层的支持 HOT 2
- 对‘fwd::TrtForwardEngine::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’未定义的引用 HOT 9
- 是否考虑重新写一个模型序列化?? HOT 3
- 与trtorch等项目的优劣对比 HOT 3
- make报错 HOT 22
- reflectPad存在两个问题 HOT 9
- 编译fwd-pytroch时提示缺少头文件 HOT 1
- 优化模型时报错 HOT 2
- [TRT] (Unnamed Layer* 0) [Convolution]: at least 4 dimensions are required for input HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forward.