Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
43 views

I am learning TensorFlow and transfer learning, and I am trying to add a TensorFlow Hub feature extractor to a Keras Sequential model. But I get this error: ValueError: Only instances of keras.Layer ...
Sanjay Jithesh's user avatar
-1 votes
1 answer
71 views

When creating a sequential MLP taking a batched input of shape [batch,n_channels,1], calling keras.layers.Input forcibly squeezes the last axis resulting in issues in an NN i'm attempting to create ...
The_Docc's user avatar
-2 votes
1 answer
586 views

ValueError: Only instances of `keras.Layer` can be added to a Sequential model. Received: <tensorflow_hub.keras_layer.KerasLayer object at 0x7c61f819f590> (of type <class 'tensorflow_hub....
Moein Nouri's user avatar
0 votes
0 answers
49 views

I get this error with trying to run my code: Traceback (most recent call last): File "/Users/kegak/AI_Project/main.py", line 24, in <module> vggface = VGGFace(model='resnet50', ...
user28522874's user avatar
2 votes
0 answers
27 views

After finetuning my dataset using keras, I tried to fit the model to lora and this was the error I encountered: TypeError Traceback (most recent call last) Cell In[12], ...
Sharon's user avatar
  • 21
2 votes
1 answer
314 views

I am trying to optimize a CNN made with KERAS. For that I wanted to use the KERAS TUNER module. However, when importing the module i get the error message: "AttributeError: module 'tensorflow....
Phasco's user avatar
  • 31
1 vote
4 answers
2k views

I encountered an error related to Sequential while working with TensorFlow Hub. Can anyone help me with this?" enter image description here "ValueError: Only instances of keras.Layer can be ...
ercan kurtoğlu's user avatar
0 votes
0 answers
79 views

I am new to Tensorflow and kKeras and I am trying to create a neural network as mentioned in the keras website. I am trying to create a baseline model with a dataset of my own. The codes are exactly ...
United Dragons's user avatar
0 votes
1 answer
59 views

I'm trying to concatenate a tensor with shape (None, 11, 1, 1) with another tensor with shape (None,1,1,1). Reading the keras.layers.Concatenate() docs I understood that the shape should be the same ...
Mitch's user avatar
  • 1
0 votes
1 answer
207 views

I am having trouble with passing "batch_input_shape" in Jupyter Lab and VScode as well. ### Defining the RNN Model ### def LSTM(rnn_units): return tf.keras.layers.LSTM( rnn_units, ...
Bluehand1984's user avatar
0 votes
1 answer
159 views

I am attempting to use YAMNet for transfer learning to perform speech command recognition. I plan to train the model using the mini speech commands dataset from the simple audio project. The goal is ...
zheng's user avatar
  • 1
0 votes
1 answer
788 views

I am trying to build this RNN below, import keras model = Sequential() input_dim=3 output_dim=1 input_length=1 model.add(keras.layers.Embedding(input_dim, output_dim, input_length=input_length)) ...
Arian's user avatar
  • 1
0 votes
0 answers
830 views

i'm new to tensorflow and keras and i'm trying to build a realtime sign detection model. I'm following Nicholas Renotte's video tutorial https://www.youtube.com/watch?v=pDXdlXlaCco&t=864s import ...
Nishi Parekh's user avatar
1 vote
2 answers
552 views

import os os.environ["KERAS_BACKEND"] = "tensorflow" import pandas as pd import pathlib import random import string import re import numpy as np import tensorflow as tf import ...
Leila Saxby's user avatar
3 votes
1 answer
2k views

While working with Embedding for an LSTM model I came across an issue with input_length: ValueError: Unrecognized keyword arguments passed to Embedding: {'input_length': 536} Is input length being ...
Connor Scott's user avatar
0 votes
0 answers
68 views

I wrote some python code to develop a siamese network. The sub-clase from keras.Model is: class modelSIAMESE(keras.Model): def init(self): super().init() input_shape = target_shape + (3,) input_a = ...
Alexander Pascau's user avatar
0 votes
1 answer
110 views

I am working on an image segmentation CNN using Keras (pytorch backend if that matters). I am basing my code off the UNET segmentation code (here which utilizes Monte-Carlo dropout during predictions ...
ZebraEagle's user avatar
0 votes
0 answers
54 views

I’m encountering an issue when trying to import the Sequential class from Keras. Here’s the code I’m running: from keras.models import Sequential from keras.layers import Embedding, LSTM, Dense model ...
Messalti Ishak's user avatar
0 votes
1 answer
37 views

I want to implement a multi-view Variational Autoencoder (VAE) model using Keras. The Code: import tensorflow as tf from tensorflow.keras import layers, models from tensorflow.keras.utils import ...
Anon's user avatar
  • 1,545
0 votes
0 answers
32 views

When executing the following code to predict the category of an image using a model trained using the fashion MNIST dataset, the following error occurs. How can I fix this error? Any advice would be ...
Mamo's user avatar
  • 1
3 votes
0 answers
97 views

I want to add a Custom Layer to a Tensorflow Model which transforms every row of a the input set to the model in a set pattern. For example, below is the custom layer than I have: class CustomLayer: ...
ConfusedScientist's user avatar
1 vote
1 answer
364 views

I am trying to build a custom 1D convolution layer in TensorFlow. I have checked that the layer does what is supposed to do. However when I insert it in a sequential Keras model I get that WARNING ...
Jake991's user avatar
  • 13
0 votes
1 answer
333 views

I've trained a neural network and am looking to save it as an FMU (Functional Mock-up Interface)file import tensorflow as tf from tensorflow.keras import layers, models, optimizers,initializers model =...
aborammez's user avatar
-3 votes
1 answer
389 views

i am following a yt tutorial and my programm shows "NameError: name 'input_shape' is not defined" did i forget to import something ?? or did the name change of the 7 months since this video ...
Rick's user avatar
  • 1
0 votes
1 answer
36 views

I'm new to tensorflow and I'm trying to build a custom layer that takes multiple inputs (namely, x,y,A) and return z. In this layer, w is the trainable parameter. my code is: import tensorflow as tf ...
K. Basul's user avatar
1 vote
1 answer
158 views

I got a nontrivial model with several nontrivial layers for which I'd like to do the following: I create a random vector of values v with length equal to the number of parameters of the model. Now I'd ...
user20780's user avatar
3 votes
1 answer
557 views

I'm trying to get all layers from within a custom layer subclassed from tf.keras.layers but I am having difficulties with this. The end goal is to create a DAG (Directed Acyclic Graph) that has layers ...
Hamza Kamran's user avatar
1 vote
0 answers
31 views

Here is my architecture. def model1(): inputs = layers.Input(shape=(x1.shape[-2],x1.shape[-1]), name='Input_layer') x = layers.Reshape((x1.shape[-2], x1.shape[-1], 1), name='Input_reshape')(...
kesav raj's user avatar
0 votes
0 answers
35 views

I'm newbie to reinforcement learning. I'd like to see and understand the code that predicts Kerath's actor critic value, and then run it with some changes. my code is simple code without normalization,...
donghyunlee's user avatar
1 vote
2 answers
536 views

I'm newbie to reinforcement learning. I'd like to see and understand the code that predicts Keras actor critic value, and then run it with some changes. Example code: https://github.com/keras-team/...
donghyunlee's user avatar
1 vote
0 answers
103 views

In the Keras tutorial it shows how to embed a text field and pass it to TFDF in this tutorial. sentence_encoder_layer = hub.KerasLayer( "https://tfhub.dev/google/universal-sentence-encoder/4&...
toille's user avatar
  • 13
1 vote
0 answers
20 views

I have used functional API to build a ResNet neural network algorithm. However, this constructed model can not save the neural networks' weights in an appropriate result. The validated result was very ...
张家瑜's user avatar
0 votes
1 answer
243 views

I have trained a neural network in Spyder, and it runs wonderfully. In order to make it faster I'm trying to test using GPUs, which is why I switched to Colab. When it unpickles my model, I get this ...
MG117's user avatar
  • 1
0 votes
0 answers
44 views

I am unable to pass Stellargraph graph as an input to Keras model using Input(). It gives an error: Failed to find data adapter that can handle input: <class 'stellargraph.core.graph.StellarGraph'&...
Aks's user avatar
  • 3
0 votes
0 answers
113 views

My goal is to design and train a model to detect points of derivative discontinuity in a line profile. The input data of my model are 1D vectors, with some geometrical shapes [as shown in Fig 3], one ...
James's user avatar
  • 11
-1 votes
1 answer
3k views

tensorflow version : t2.13.0-rc1 import os import cv2 import numpy as np import pandas as pd import tensorflow as tf import pytesseract as pt import plotly.express as px import matplotlib.pyplot as ...
Abdul Faiz's user avatar
1 vote
0 answers
1k views

In my project I have dataset of original images and correcponding masks. I want to perform augmentation so it is random, yet same for image and matching mask. For this I have defined keras sequential ...
Jan Mareš's user avatar
0 votes
1 answer
1k views

I am trying to understand why there is a difference between calculating a dense layer operation directly and using the keras implementation. Following the documentation (https://www.tensorflow.org/...
ySmith's user avatar
  • 5
2 votes
0 answers
116 views

Given a numpy database of size (128, 47088), I need to send a data sequence to the training model, for example: This image is a sample for illustrative purposes only Send the data from columns 0, 1, 2,...
Leandro's user avatar
  • 21
0 votes
0 answers
57 views

I want to concatenate 3 parallel layers each with Input(shape=(1,)) for multiclass classification. _______ input_1(feature[10000,0])----> dense ----> |...
Nikki Mino's user avatar
1 vote
0 answers
43 views

I am new to Keras API , I am able to get Map as response but i am not able to get userdefined key names in response For Ex: My Expected response is { "predictions": [ { ...
Vijay Manohar's user avatar
1 vote
1 answer
95 views

I am trying to add a random noise during forward pass to a convolutional layer in Keras. I wrote a wrapper class where it would add noise to the weights before computing convolution. Any addition or ...
hmedu's user avatar
  • 13
0 votes
0 answers
51 views

Equation to be coded Model showing what the equation does I would like to be code the equation attached in a custom layer. This layer will accept inputs of dimensions (None,3) & (None,37,3) and ...
A R's user avatar
  • 1
2 votes
0 answers
520 views

I'm trying to build a TFLite Audio Classification Model and for that I have integrated Preprocess Function with the Model in a single file. The following code is to combine my model with the ...
Silent's user avatar
  • 55
0 votes
2 answers
372 views

I'm using for the first time tf.data.dataset to feed a model. I look on some exemple but don't find how to use multi-inputs on a 2 heads model. My first input as shape[nb_samples, nb_timesteps, ...
Jonathan Roy's user avatar
3 votes
1 answer
8k views

import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline from wordcloud import WordCloud from bs4 import BeautifulSoup import re import nltk ...
NOORDEEN M's user avatar
1 vote
0 answers
166 views

I have trained a simple classification model based on https://keras.io/examples/nlp/text_classification_from_scratch that uses a WordPieceTokenizer & StartEndPacker to pre-process the input ...
FrozenKiwi's user avatar
  • 1,513
0 votes
1 answer
1k views

I work on importing TensorFlow models into MATLAB, this includes de-serializing the SavedModel format, identifying the different tf.keras.layers present in the SavedModel and creating an equivalent ...
Meghendra's user avatar
  • 691
0 votes
1 answer
50 views

I have written a program with Python Keras but it gives the following error: import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation, Dropout from keras....
willy.js's user avatar
0 votes
1 answer
331 views

So I want to try out an adaptive activation function for my neural network. This means I want to have a custom loss that is similar to a standard one (like tanh or relu), however I want to add some ...
PlatinumBard's user avatar

1
2 3 4 5
31