Categories
Artificial Intelligence (AI) Mastering Development

Understanding Basic notions of Neural Networks Terms

i have read a lot of information about several notions, like batch_size, epochs,iterations, but because of explanation was without numerical examples and i am not native speaker, i have some kind of problem of understanding still about those terms, so i decided to work with data and step by step show what i have done […]

Categories
Mastering Development

I am getting an error when using model.fit in colab to train a cnn model

I’m trying to train a CNN model in “COLAB” and when i start training using model.fit like this model.fit(X_train_images, Y_train_labels, n_epoch=100, shuffle=True, validation_set=(X_val_images, Y_val_labels), show_metric=True, batch_size=96, snapshot_epoch=True, run_id=’nodule-classifier’) I am getting this kind of error image Can anyone help me solve this please??

Categories
Development

DCGAN debugging. Getting just garbage

Introduction: I am trying to get a CDCGAN (Conditional Deep Convolutional Generative Adversarial Network) to work on the MNIST dataset which should be fairly easy considering that the library (PyTorch) I am using has a tutorial on its website. But I can’t seem to get It working it just produces garbage or the model collapses […]

Categories
Development

Regarding performance of GPU GTX1060 for deep learning

I have GTX1060 graphic card and i have installed CUDA 10.1 also . I am working on a python project . I have data set of size 1.5 GB (70,000 images). but my model VGG-16 (transfer learning) is taking 40 mins for epoch. if i train it for 50 epochs my laptop may be dead […]

Categories
Development

ValueError: Error when checking input: expected input_1 to have 5 dimensions, but got array with shape (10000, 32, 3, 32)

I am trying to train a 3d cnn network on Cifar 10 dataset, but I got the following error: Traceback (most recent call last): File “kI3DV2s.py”, line 286, in <module> callbacks=[]) File “C:\Users\sancy\Anaconda3\envs\tensorflow\lib\site-packages\keras\legacy\interfaces.py”, line 91, in wrapper return func(*args, **kwargs) File “C:\Users\sancy\Anaconda3\envs\tensorflow\lib\site-packages\keras\engine\training.py”, line 1732, in fit_generator initial_epoch=initial_epoch) File “C:\Users\sancy\Anaconda3\envs\tensorflow\lib\site-packages\keras\engine\training_generator.py”, line 150, in fit_generator val_x, val_y, […]

Categories
Development

How to use ResNet152 in tensorflow.keras to train it on my own data?

I am trying to build my own network using ResMet152 in Colab. Here is the part of my code : (x_train, y_train), (x_test, y_test) = cifar10.load_data() x_train = x_train.astype(‘float32’) x_test = x_test.astype(‘float32’) # Normalization mean = np.mean(x_train, axis=0) std = np.std(x_train, axis=0) x_train = (x_train – mean) / (std+1e-7) x_test = (x_test – mean) / […]

Categories
Development

module tensorflow has no attribute get default graph

I am getting the following error, i don’t know what it means. I am trying to follow this person’s instruction from youtube: https://www.youtube.com/watch?v=HbWamLW0_wU from sklearn.model_selection import StratifiedKFold kfold = StratifiedKFold(n_splits=3, shuffle=True, random_state=0) cvscores = [] for train, test in kfold.split(X_new, y_res): #create model model = Sequential() model.add(Dense(200, input_dim=X_new.shape[1], activation=’relu’)) model.add(Dense(400, activation=’relu’)) model.add(Dense(4, activation =’relu’)) model.add(Dense(1, […]

Categories
Development

How to write a generator for keras fit_generator?

This question is a further step of this question. My data inputs are tens of .csv files, I have already read input data until the follow format: # train_x is data, train_y is label print(train_x.shape) # (2000000,10,100) 3D array print(train_y.shape) # (2000000,) labels I already can fit & evaluate them using: model.fit(train_x, train_y, batch_size=32, epochs=10) […]

Categories
Development

Difference between va_loss from fit and score from evaluate?

I am learning to use tf and Keras with a regression problem. I have written this function for cross-validate differents models, in order to compare them. def cv(X, y, model, n_splits=5, epochs=5, batch_size=1024, random_state=42, verbose=0): # kf = KFold(n_splits=n_splits, shuffle=True, random_state=random_state) kf = KFold(n_splits=n_splits, shuffle=False, random_state=random_state) histories = [] for s in kf.split(X): X_train = […]

Categories
Development

Difference between va_loss from fit and score from evaluate?

I am learning to use tf and Keras with a regression problem. I have written this function for cross-validate differents models, in order to compare them. def cv(X, y, model, n_splits=5, epochs=5, batch_size=1024, random_state=42, verbose=0): # kf = KFold(n_splits=n_splits, shuffle=True, random_state=random_state) kf = KFold(n_splits=n_splits, shuffle=False, random_state=random_state) histories = [] for s in kf.split(X): X_train = […]