keras-layer

Keras Concatenate TypeError: __init__() got multiple values for argument 'axis'

两盒软妹~` 提交于 2021-02-09 05:49:14
问题 I am currently trying to recreate the Unet. At the "upconvolution" part where the outputs of two layers needs to be merged I got the mentioned error. (TypeError: init () got multiple values for argument 'axis') Keras Version: 2.0.6 Tensorflow-gpu: 1.2.1 Code snippet: import gzip import os from six.moves import urllib import tensorflow as tf import numpy as np from keras.models import Sequential, Model from keras.layers import Input, Dropout, Flatten, Concatenate from keras.layers import

Keras Concatenate TypeError: __init__() got multiple values for argument 'axis'

与世无争的帅哥 提交于 2021-02-09 05:47:45
问题 I am currently trying to recreate the Unet. At the "upconvolution" part where the outputs of two layers needs to be merged I got the mentioned error. (TypeError: init () got multiple values for argument 'axis') Keras Version: 2.0.6 Tensorflow-gpu: 1.2.1 Code snippet: import gzip import os from six.moves import urllib import tensorflow as tf import numpy as np from keras.models import Sequential, Model from keras.layers import Input, Dropout, Flatten, Concatenate from keras.layers import

IndexError: list index out of range in model.fit()

∥☆過路亽.° 提交于 2021-02-08 03:33:30
问题 I am new in using tensorflow. I am trying to train my network with images of shape (16*16). I have divided 3 grayscale images of 512*512 into 16*16 and appended all. so i have 3072*16*16. while training I am getting error. I am using jupyter notebook.Can anyone please help me? Here is the code import tensorflow as tf import numpy as np from numpy import newaxis import glob import os from PIL import Image,ImageOps import random from os.path import join import matplotlib.pyplot as plt from

Backward propagation in Keras?

こ雲淡風輕ζ 提交于 2021-02-06 15:11:41
问题 can anyone tell me how is backpropagation done in Keras? I read that it is really easy in Torch and complex in Caffe, but I can't find anything about doing it with Keras. I am implementing my own layers in Keras (A very beginner) and would like to know how to do the backward propagation. Thank you in advance 回答1: You simply don't. (Late edit: except when you are creating custom training loops, only for advanced uses) Keras does backpropagation automatically. There's absolutely nothing you

Backward propagation in Keras?

拜拜、爱过 提交于 2021-02-06 15:08:48
问题 can anyone tell me how is backpropagation done in Keras? I read that it is really easy in Torch and complex in Caffe, but I can't find anything about doing it with Keras. I am implementing my own layers in Keras (A very beginner) and would like to know how to do the backward propagation. Thank you in advance 回答1: You simply don't. (Late edit: except when you are creating custom training loops, only for advanced uses) Keras does backpropagation automatically. There's absolutely nothing you

How to change Sequential model to Custom Class model

可紊 提交于 2021-01-29 22:12:53
问题 I'm learning tensorflow 2.0 from its older versions. I found tensorflow model is changed Sequential-base from Class-base. But I want to use Class-base model because it is easy to read for me. I want to try translate : https://www.tensorflow.org/beta/tutorials/keras/basic_text_classification_with_tfhub embedding = 'https://tfhub.dev/google/tf2-preview/gnews-swivel-20dim/1' hub_layer = hub.KerasLayer(embedding, input_shape=[], dtype=tf.string, trainable=True) # hub_layer(train_example_batch[:3]

How to change Sequential model to Custom Class model

霸气de小男生 提交于 2021-01-29 21:15:09
问题 I'm learning tensorflow 2.0 from its older versions. I found tensorflow model is changed Sequential-base from Class-base. But I want to use Class-base model because it is easy to read for me. I want to try translate : https://www.tensorflow.org/beta/tutorials/keras/basic_text_classification_with_tfhub embedding = 'https://tfhub.dev/google/tf2-preview/gnews-swivel-20dim/1' hub_layer = hub.KerasLayer(embedding, input_shape=[], dtype=tf.string, trainable=True) # hub_layer(train_example_batch[:3]

Keras: Using model output as the input for another: When feeding symbolic tensors to a model, we expect thetensors to have a static batch size

我是研究僧i 提交于 2021-01-29 17:27:47
问题 I have the following two models, where model_A is trained first, then the output of model_A is used to train the model_C : import keras from keras.layers import Input, Dense from keras.models import Model inputs = Input(shape=(12,)) # --------------------------------------- # model_A x = Dense(64, activation='relu')(inputs) x = Dense(64, activation='relu')(x) predictions_A = Dense(3, activation='softmax')(x) model_A = Model(inputs=inputs, outputs=predictions_A) model_A.compile(optimizer=

TypeError: 'Tensor' object is not callable | Keras-Bert

守給你的承諾、 提交于 2021-01-29 09:31:13
问题 I'm building this model: inputs = model.inputs[:2] layer_output = model.get_layer('Encoder-12-FeedForward-Norm').output input_layer= keras.layers.Input(shape=(SEQ_LEN,768))(layer_output) conv_layer= keras.layers.Conv1D(100, kernel_size=3, activation='relu', data_format='channels_first')(input_layer) maxpool_layer = keras.layers.MaxPooling1D(pool_size=4)(conv_layer) flat_layer= keras.layers.Flatten()(maxpool_layer) outputs = keras.layers.Dense(units=3, activation='softmax')(flat_layer) model =

Why Keras Lambda-Layer cause problem Mask_RCNN?

▼魔方 西西 提交于 2021-01-29 05:28:04
问题 I'm using the Mask_RCNN package from this repo: https://github.com/matterport/Mask_RCNN . I tried to train my own dataset using this package but it gives me an error at the beginning. 2020-11-30 12:13:16.577252: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1 2020-11-30 12:13:16.587017: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected 2020-11-30