Questions tagged [keras-2]

with a new API.

Keras API will now become available directly as part of

264 questions
0
votes
0 answers

Keras model custom signatures are not saved when learning is done on GCP

After reading blog "An Object Oriented Approach To Train an Image Classifier with Tensorflow" I've tried to set custom signatures for my Keras model (TF2) like this: class ImageClassifierModel(tf.keras.Model): def __init__(self,...) def…
Patrick
  • 2,577
  • 6
  • 30
  • 53
0
votes
0 answers

name 'model' is not defined while importing plot model from keras.util.vis.utils

My keras version is 2.2.4 and tf is 1.15.3. Code to create the model: import numpy as np import pandas as pd %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import…
0
votes
1 answer

Why do Keras layers behave differently when copy/pasted into my script?

When I copy-and-paste TF's PReLU layer to my own script, it appears to build differently than the packaged version. Below I show a toy model with the PReLU code from my installation (2.9.2 on mac m1) fail to report any trainable parameters. In the…
Mack
  • 11
  • 3
0
votes
1 answer

x and y can be no greater than 2D, in the graph

fixing an error ValueError: x and y can be no greater than 2-D, but have shapes (23,) and (23, 12, 1) and to make my original graph with prediction graph line
0
votes
1 answer

Convert tflearn to keras

Since tflearn is outdated and I am watching a chatbot tutorial that uses tflearn, I want to write the neural network model in keras. However, I got this error right here: WARNING:tensorflow:Model was constructed with shape (None, 58) for input…
0
votes
1 answer

Keras v1 to v2 Convolution3D Layer coversion

I am trying to replicate the model in [Sports 1M C3D Network] (https://gist.github.com/albertomontesg/d8b21a179c1e6cca0480ebdf292c34d2) to Keras v2. I am not able to replicate the input and output shapes. I read through the documentation and still…
vishnu
  • 79
  • 1
  • 1
  • 3
0
votes
0 answers

Cannot `import name '_Merge' from 'keras.layers.merge`' in Tensorflow2

I am trying to run the following code on an environment which has Tensorflow 2 installed: from keras.layers.merge import _Merge class RandomWeightedAverage(_Merge): """Provides a (random) weighted average between real and generated image…
Ehsan
  • 56
  • 4
0
votes
0 answers

Non printable characters during model training

I am training on a timeseries dataset using conv1D but during training I am getting non printable characters along with training status like 2044/42401 [>.............................] - ETA: 1:12 - loss: 0.5781 - accuracy: 0.7441 So I loaded the…
sunnyboy
  • 43
  • 5
0
votes
1 answer

Keras kernel_initializer must either be wrapped in an init_scope or callable error

I noticed that assigning the keras.initializer inside a layer results in an error claiming that the variable initializers must either be wrapped in an init_scope or callable. However, I fail to see how my below use-case is different than the example…
daniels_pa
  • 267
  • 4
  • 13
0
votes
1 answer

Customising model in AWS sagemaker

I have a python script which I wrote using tensorflow python 3.6 AWS sagemaker jupyter notebook inside AWS sagemaker instance. I have to use sagemaker debugger for my Deep Learning model. I can see many links suggesting that first dockerise the…
0
votes
0 answers

How to update a model.json saved in keras 1.1.0 to latest (tensorflow 2.3.1)?

I'm creating a pull request to https://github.com/WaqasSultani/AnomalyDetectionCVPR2018, updating https://github.com/WaqasSultani/AnomalyDetectionCVPR2018/blob/master/Test_Anomaly_Detector_public.py to python3 and the latest keras (now part of…
WurmD
  • 1,231
  • 5
  • 21
  • 42
0
votes
0 answers

getting import error, DLL file load failed, having python3.7 , installed tensorflow and keras, still the same errror

C:\Users\Raj Kubal>python Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Warning: This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may…
Raj Kubal
  • 1
  • 1
0
votes
1 answer

A very strange behavior of a function when I pass arguments in Keras

I have created a function to train and evaluate a model in keras2 , tensorflow2. Here is my code: def f_compile_fit_evaluate_model1(filters1, kernel_size1, filters2 , kernel_size2, epochs): setting1 = Input(shape = (10,8), name = 'setting1') …
user8270077
  • 4,621
  • 17
  • 75
  • 140
0
votes
0 answers

In accessing intermediate layers of keras pretrained model - error message: "AttributeError: 'tuple' object has no attribute 'layer'"

I am trying to access the output of an intermediate layer of a pretrained keras model but I am getting an exception. My code is the following: from keras.applications import vgg16 model = vgg16.VGG16(weights='imagenet',…
user8270077
  • 4,621
  • 17
  • 75
  • 140
0
votes
1 answer

What does self.iterations refer to in Keras' Optimizer class

I've been trying to understand Keras' Optimizer class, and realize that there's a variable I don't quite understand - self.iterations. Does this refer to: The number of individual samples for which updates have been performed? The number of…
user1245262
  • 6,968
  • 8
  • 50
  • 77