Giter Site home page Giter Site logo

Comments (8)

yuanzexi avatar yuanzexi commented on April 28, 2024

@YuzhouPeng 可以的~ Forward 的 Plugins 目录中也有引入 TensorRT 官方的 embLayerNormPlugin 的。

from forward.

YuzhouPeng avatar YuzhouPeng commented on April 28, 2024

@yuanzexi 大佬,我还想请教下,embLayerNormPlugin 里面需要输入layernorm,word embedding,token embeddingg等参数,而且输入有三个,但是我keras使用embedding的时候只输入了一个32位数组,像这种情况embLayerNormPlugin 的那些参数该怎么设置比较好呢?
屏幕截图 2021-06-28 085335

from forward.

yuanzexi avatar yuanzexi commented on April 28, 2024

@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.

chenjun2hao avatar chenjun2hao commented on April 28, 2024

@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.

zhaoyiluo avatar zhaoyiluo commented on April 28, 2024

Hello @chenjun2hao

我们刚测试了下,发现 build.sh 可以成功运行,推测可能是环境配置造成的错误。

希望你这边可以提供这些信息,以便我们做进一步判断。

  1. 提供修改后的 build.sh 文件内容

  2. 注释 build.sh 的最后一行 make -j,并运行 build.sh,提供脚本运行的结果

谢谢~

from forward.

chenjun2hao avatar chenjun2hao commented on April 28, 2024

@zhaoyiluo ,你好。动态库是可以编译出来的。但是用动态库编译demo下来的exe的时候报上面的错误。我用另外一台电脑测试,也出现同样的问题。

from forward.

github-actions avatar github-actions commented on April 28, 2024

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.

github-actions avatar github-actions commented on April 28, 2024

This issue was closed because it has been stalled for 5 days with no activity.

from forward.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.