Comments (4)
Actually, any model in Tensorflow, as far as I know, different batch size can not be setted whatever in training or in inference process. Hence, I suggest that you can set the batch size in tf.placeholder with None
, which will avoid this problem you suffered.
from rnn.
Thanks for your quick reply. More specifically, starting from Line 90 in ConvLSTM.py (peephole part), 'w_ci' is defined by vs.get_variable("w_ci", cell.shape, inputs.dtype), which results in shape [512, 7, 7, 128] during training, and 512 is the batch size I set in this case. However if I set batch size to 1000 during inference, the shape of 'w_ci' will change to [1000, 7, 7, 128], which, will fail because this is not consistent with the training shape.
Apparently the first dimension of 'w_ci' cannot be None or -1 in this case otherwise the variable cannot be created. However once the variable is created, the shape is also fixed, which leads to unchangeable batch size.
If I set off the peephole mode, this problem will not appear which means I can set different batch size. So this problem is a little bit weird to me. I will try fixing it.
from rnn.
Thanks for your reminder. After check carefully, it should be a vital bug. And it has been debuged as follow:
kernel_shape = cell.shape.as_list()[-3:]
w_ci = vs.get_variable(
"w_ci", kernel_shape, inputs.dtype)
w_cf = vs.get_variable(
"w_cf", kernel_shape, inputs.dtype)
w_co = vs.get_variable(
"w_co", kernel_shape, inputs.dtype)
You can change your code in your project, and if there is any problem, please feel free to contact me.
from rnn.
Everything looks well! Thanks for your help!
from rnn.
Related Issues (2)
- 在use_attention=False会报错 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 rnn.