Category : tensorflow

This is my model- class CNNHyperModel(HyperModel): def __init__(self, input_shape, num_classes): self.input_shape = input_shape self.num_classes = num_classes def build(self, hp): model = keras.Sequential() model.add( Conv1D( filters=hp.Int( "neurons_1", min_value=20, max_value=400, step=20, default=200,), kernel_size=hp.Int("kernal_sizes_1", min_value=1, max_value=10, step=1, default=3,), strides=hp.Int("stride_sizes_1", min_value=1, max_value=10, step=1, default=3,), activation="relu", input_shape=(25,1), padding="same", ) ) model.add( Dropout( rate=hp.Float( "dropout_1", min_value=0.0, max_value=0.5, default=0.25, step=0.05, ) ) ..

Read more

I have the following code and I obtain ‘TypeError: ‘tuple’ object is not callable'(in new_time) but I dont understand why. I wrote it based on this tutorial https://jalammar.github.io/a-visual-guide-to-using-bert-for-the-first-time/ and https://github.com/getalp/Flaubert My code : #torch == 1.8.1 #numpy == 1.20.2 #pandas == 1.0.3 #transformers == 4.6.1 from transformers import logging logging.set_verbosity_warning() import numpy as np import ..

Read more

import random import json import pickle import numpy as np import nltk from nltk.stem import WordNetLemmatizer from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation, Dropout from tensorflow.keras.optimizers import SGD lemmatizer = WordNetLemmatizer intents = json.loads(open(‘intents.json’).read()) words = [] classes = [] documents = [] ignore_letters = [‘!’,’?’,’.’,’,’] for intent in intents[‘intents’]: for pattern in ..

Read more

I’m just studying how to use tensorflow 2.x version. But my code occurs error, and I don’t know the reason. import cv2 import matplotlib.pyplot as plt img = cv2.imread(‘dataset/bird_pic_by_benjamin_planche.png’, cv2.IMREAD_GRAYSCALE) import tensorflow as tf import tensorflow.keras as keras img = tf.constant(img) img = tf.reshape(img, [1, 680, 608]) img = tf.reshape(img, [1, 680, 608, 1]) parameters ..

Read more

I’ve created an emotion detection Model with resnet50 and I’m using the Adam optimizer. However, I get the following error TypeError: set_model() missing 1 required positional argument: ‘model’ And here’s my code to create a model: # Build model on the top of base model model = Sequential() model.add(base_model) model.add(Dropout(0.5)) model.add(Flatten()) model.add(BatchNormalization()) # fully connected ..

Read more

I’m trying to run the code in the link below. https://github.com/myeungun/SAR-water-segmentation To run the code, I need 5 prerequisites. CUDA 10.0 Python 3.7.7 Tensorflow 1.14.0 PyTorch 0.4.1 Keras 2.3. I tried to install those packages after creating a new environment in anaconda. However, installing these packages one by one keeps causing inconsistencies. Is there any ..

Read more