I am trying to use the VGG16 network for multiple input images. Training this model using a simple CNN with 2 inputs gave me an acc. of about 50 %, which is why I wanted to try it using an established model like VGG16. Here is what I have tried out: I get this error while calling the Model function.
Tag: deep-learning
tf.train.Checkpoint is restoring or not?
I am running tensorflow 2.4 on colab. I tried to save the model using tf.train.Checkpoint() since it includes model subclassing, but after restoration I saw It didn’t restored any weights of my model. Here are few snippets: When I later restored it I didn’t get any gru weights: I also tried checkpoint.restore(manager.latest_checkpoint) but nothing changed. Is there any thing wrong
Traing a CNN using Prelu activation function
I’m trying to train the model using prelu activation function, but I get the following error I’m using the below-mentioned code, kindly let me know how do I correct it. Answer Your tensor input is wrong. You need to set it up like this way Full working code
Pytorch crashes cuda on wrong line
How to see which python line causes a cuda crash down the line in Pytorch, which executes asynchronous code outside of the GIL? Here is a case where I had Pytorch crash cuda, running this code on this dataset and every run would crash with the debugger on a different python line, making it very difficult to debug. Answer I
Gradient Accumulation with Custom model.fit in TF.Keras?
Please add a minimum comment on your thoughts so that I can improve my query. Thank you. -) I’m trying to train a tf.keras model with Gradient Accumulation (GA). But I don’t want to use it in the custom training loop (like) but customize the .fit() method by overriding the train_step.Is it possible? How to accomplish this? The reason is
Pytorch: 1D target tensor expected, multi-target not supported
I want to train a 1D CNN on time series. I get the following error message 1D target tensor expected, multi-target not supported Here is the code with simulated data corresponding to the structures of my data as well as the error message Error message: What am I doing wrong? Answer You are using nn.CrossEntropyLoss as the criterion for your
Why do sometimes CNN models predict just one class out of all others?
I am relatively new to the deep learning landscape, so please don’t be as mean as Reddit! It seems like a general question so I won’t be giving my code here as it doesn’t seem necessary (if it is, here’s the link to colab) A bit about the data: You can find the original data here. It is a downsized
converting xavier to glorot in tensorflow code
I am trying to convert xavier initializer in a tensorflow code to glorot initializer. I am not sure which one of the following (or other options) is correct? Answer Based on the code for xavier_initializer, the default is uniform=True which suggests glorot_uniform may be what you want. If you are using tf2, you may use tf.keras.initializers.GlorotUniform(). tf.keras.initializers.glorot_uniform is just a
Keras my_layer.output returning KerasTensor object instead of Tensor object (in custom loss function)
I’m trying to build a custom loss function in Keras v2.4.3: (as explained in this answer) But I think it’s behaving much different than expected (perhaps because of my Keras version?), I’m getting this error: And I think that’s because encoder.get_layer(‘mean’).output is returning a KerasTensor object instead of a tf.Tensor object (as the other answer indicates). What am I doing
ImportError: cannot import name ‘keras_tensor’ from ‘tensorflow.python.keras.engine’
I’m getting this error while loading the tensorflow addons library Answer This error is because you have incompatibility issues between your TensorFlow, Python and tensorflow-addons. Uninstall the tensorflow-addons and install the version based on the table below. Refer the Github repo for more information.