You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
i am receiving multiple error with Different architecture of deep learning model, most of the time segmentation fault, tried changing my code to use a simple multilayer architecture to train a model of mnist dataset , got the error as
F tensorflow/core/common_runtime/pool_allocator.cc:138] Check failed: (void*)cp <= (void*)ptr (0x7fffffff7fffffff vs. 0x12dfb6fc0).
below is my code to replicate the issue.
from tensorflow.keras.datasets import mnist
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten, Conv2D, MaxPool2D, Dropout
from tensorflow.keras.optimizers import SGD, Adam
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
i am receiving multiple error with Different architecture of deep learning model, most of the time segmentation fault, tried changing my code to use a simple multilayer architecture to train a model of mnist dataset , got the error as
F tensorflow/core/common_runtime/pool_allocator.cc:138] Check failed: (void*)cp <= (void*)ptr (0x7fffffff7fffffff vs. 0x12dfb6fc0).
below is my code to replicate the issue.
from tensorflow.keras.datasets import mnist
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten, Conv2D, MaxPool2D, Dropout
from tensorflow.keras.optimizers import SGD, Adam
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
((trainData, trainLabels), (testData, testLabels)) = mnist.load_data()
data = np.vstack([trainData, testData])
labels = np.hstack([trainLabels, testLabels])
data = np.array(data, dtype="float32")
data = np.expand_dims(data, axis=-1)
data /= 255.0
le = LabelBinarizer()
labels = le.fit_transform(labels)
counts = labels.sum(axis=0)
classTotals = labels.sum(axis=0)
classWeight = {}
for i in range(0, len(classTotals)):
classWeight[i] = classTotals.max() / classTotals[i]
(trainX, testX, trainY, testY) = train_test_split(data, labels, train_size=0.80,stratify=labels, random_state=0)
aug = ImageDataGenerator(
rotation_range=10,
zoom_range=0.05,
width_shift_range=0.1,
height_shift_range=0.1,
shear_range=0.15,
horizontal_flip=False,
fill_mode="nearest")
model=Sequential()
model.add(Conv2D(filters=32, kernel_size=(3,3),activation='relu', input_shape=(28,28,1)))
model.add(MaxPool2D(pool_size=(2,2),strides=2))
model.add(Conv2D(filters=64, kernel_size=(3,3), activation='relu', padding='same'))
model.add(MaxPool2D(pool_size=(2,2),strides=2))
model.add(Conv2D(filters=128,kernel_size=(3,3), activation='relu',padding='valid'))
model.add(MaxPool2D(pool_size=(2,2),strides=2))
model.add(Flatten())
model.add(Dense(64,activation='relu'))
model.add(Dense(128,activation='relu'))
model.add(Dense(10,activation='softmax'))
EPOCHS=10
opt = SGD(lr=0.01, decay=0.01 / EPOCHS)
model.compile(loss="categorical_crossentropy", optimizer=opt,
metrics=["accuracy"])
H = model.fit(
aug.flow(trainX, trainY, batch_size=16),
validation_data=(testX, testY),
steps_per_epoch=len(trainX) // 16,
epochs=EPOCHS,
class_weight=classWeight,
verbose=1)
The text was updated successfully, but these errors were encountered: