Comments (11)
LSTM有两个输出,你只保留第一个输出就可以了,状态输入和输出需要单独做处理
from tinyneuralnetwork.
LSTM有两个输出,你只保留第一个输出就可以了,状态输入和输出需要单独做处理
那我这里并没有看到处理第几个输出的接口,只看到了 converter.convert()
部分,请问保留输出的接口在哪里啊?
from tinyneuralnetwork.
需要改模型,下面这样就可以导出了
class Model(nn.Module):
def __init__(self):
self.lstm = nn.LSTM(...)
def forward(self, x):
return self.lstm(x)[0]
from tinyneuralnetwork.
LSTM有两个输出,你只保留第一个输出就可以了,状态输入和输出需要单独做处理
那我这里并没有看到处理第几个输出的接口,只看到了
converter.convert()
部分,请问保留输出的接口在哪里啊?
目前没有提供修改输出的接口,因为不像onnx或者frozen model,变量的名字是无法预先得知的,你很难去指定
from tinyneuralnetwork.
需要改模型,下面这样就可以导出了
class Model(nn.Module): def __init__(self): self.lstm = nn.LSTM(...) def forward(self, x): return self.lstm(x)[0]
谢谢,我刚刚尝试了下,单层的可以,多层的好像不行?请问对于多层LSTM/GRU的使用有什么说明吗?
from tinyneuralnetwork.
@Ironbrotherstyle 多层的应该也可以啊,GRU TFLite这边不支持,多层LSTM不支持的话,你给个样例,我试试
from tinyneuralnetwork.
又换了个测试方案多层LSTM可以了,谢谢,非常很棒的工作。省去了之前转多次模型的复杂流程(还可能遇到LSTM转换失败的问题)。
from tinyneuralnetwork.
谢谢你的支持,我在考虑要不要加个LSTM的FAQ
from tinyneuralnetwork.
可以加上,不然很容易有我这样的疑惑。一一回复不方便。
from tinyneuralnetwork.
主要还得写双语文档,头疼(
from tinyneuralnetwork.
https://github.com/alibaba/TinyNeuralNetwork/blob/main/docs/FAQ.md#how-to-convert-a-model-with-lstm
https://github.com/alibaba/TinyNeuralNetwork/blob/main/docs/FAQ_zh-CN.md#%E7%AE%97%E5%AD%90%E4%B8%8D%E6%94%AF%E6%8C%81%E5%A6%82%E4%BD%95%E5%A4%84%E7%90%86
from tinyneuralnetwork.
Related Issues (20)
- Meet Detailed error: Tensor-likes are not close! using TFLiteConverter HOT 2
- [Converter] Need transpose optimization HOT 2
- Float model failed to convert to TFLite
- [converter] map gather(+reshape) ops with seperate consecutive indices to split(unpack) ops
- tinynn.converter module not found! HOT 2
- [CI] several tests for modifier failed
- Whether to support pytorch to keras HOT 1
- TransposeConv wrong shape? HOT 15
- change input to INT8 after converting to tflite HOT 2
- [converter] implement torch's `aten::scaled_dot_product_attention` operator HOT 2
- Request: clamp would be more efficient to go to Bounded Relu than Maximum + Minimum HOT 3
- Do not support PReLU module? HOT 5
- torch.max not working HOT 2
- OneShotChannelPruner results in the miss of some operators HOT 4
- KeyError when executing quantization HOT 5
- PyTorch 转 TFLite 使用 int8 量化 HOT 4
- Does tinynn support following int16 quantization? HOT 1
- jit.trace succeed but tinynn tracer failed HOT 1
- It became larger after converting to tflite model HOT 4
- how to do Post-training integer quantization with int16 activation HOT 4
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 tinyneuralnetwork.