Comments (5)
What's even more weirder is that I'm defining the input sizes explicitly like so:
Config.COMPUTED_BATCH_SIZE = 128
with strategy.scope():
model = my_model()
input_shapes = [
[Config.COMPUTED_BATCH_SIZE, 192],
[Config.COMPUTED_BATCH_SIZE, 192],
[COMPUTED_CHANNELS, 105, 129, 100],
[COMPUTED_CHANNELS, 105, 129, 100],
[COMPUTED_CHANNELS, 105, 129, 100],
[Config.COMPUTED_BATCH_SIZE, 70],
[Config.COMPUTED_BATCH_SIZE, 320]
]
model.build(input_shape=input_shapes)
But the batch size shown in the error log is 256 in [70, 256] which I assume is the transposed tensor.
Ignore this since it appears that Hidden Size * 2 is also 256. So it could be a transpose inside a Dense layer.
Edit:
I've tracked it down to this code:
hidden_size = 128
self.descriptor_embedding = layers.Dense(
hidden_size * 2, # 256
activation='relu',
input_shape=(Config.COMPUTED_BATCH_SIZE, 70)
)
learned_descriptors = tf.expand_dims(
self.descriptor_embedding(descriptors),
1
) # [BS, 1, HS * 2]
from tensorflow.
It seems to be an issue with tf.expand_dims(x, axis=1)
. Any axis other than 0 will cause this error. tf.transpose
also causes this error.
from tensorflow.
@vivekjoshy,
When I tried to execute the code by explicitly setting the size after you decode, using tf.reshape, the code was executed successfully. While with the other approach it was executed with the error.
tf.reshape(tf.image.decode_jpeg(image, channels = 3),[256,256, 3]), class_idx
Kindly find the gist of it here.
from tensorflow.
Fixed by passing in explicit shapes everywhere.
from tensorflow.
Are you satisfied with the resolution of your issue?
Yes
No
from tensorflow.
Related Issues (20)
- Tensorflow Developer certificate didnt recieved yet HOT 1
- TFLite for LSTM: Downscale accumulation from 32-bit to 16-bit before applying to activation HOT 2
- TypeError: len is not well defined for a symbolic Tensor (rnn_decoder_1/gru_1/Squeeze:0). Please call `x.shape` rather than `len(x)` for shape information. HOT 1
- dynamic input shape with InferenceRunner
- Trouble Running TensorFlow v2.16.1 with NVIDIA GeForce 940MX GPU #914 HOT 1
- There is no target called wheel HOT 2
- TensorFlow Cuda in Docker under WSL2 not wokring HOT 13
- "CUDA_ERROR_NOT_FOUND: named symbol not found" in Docker container HOT 10
- There was no error when converting the lite model but an error occurred when calling the Interpreter allocate_tensors() method. It will appear if the Conv1D data_format parameter is set to channels_first and the dilation_rate parameter > 1 HOT 2
- Issue with Tesnorflow JS Face Detection on Production HOT 4
- [RNN] LSTM Model conversion error after upgrading to tf 2.16.1 from 2.15 HOT 3
- Training model with the Poisson loss function and the Adam optimizer resulted in NaN loss HOT 1
- Bazel compiling source code failed because of highwayhash/sip_hash.cc HOT 2
- segmentation fault when tf.histogram_fixed_width receives large `value_range` and `nbins` on CPU mode
- Wrong explanation about an argument of tflite interpreter HOT 1
- Not able to build TensorFlow with GPU support HOT 2
- ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following types in the input: [<class 'int'>] HOT 1
- __add__ with floating point values HOT 1
- TypeError: Expected int32, got 1e-07 of type 'float' instead.
- Current tensorflow[and-cuda] installed by pip pulls ptxas which causes Jupyter kernel restart
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 tensorflow.