apple / tensorflow_macos

TensorFlow for macOS 11.0+ accelerated using Apple's ML Compute framework.
Other
3.66k stars 308 forks source link

Segmentation fault: 11 - when running a deep learning model with Tensorflow and Keras on Macbook M1 #177

Open yasith93 opened 3 years ago

yasith93 commented 3 years ago

I'm using an Apple Macbook Pro M1 8GB. I'm running a deep learning model with the following imports (tensorflow_macos version 2.4.0-rc0 and Keras version 2.4.3)

import numpy as np;
import keras;
from keras. layers.core import Dense, Flatten, Activation;
from keras.optimizers import Adam;
from keras.metrics import binary_crossentropy;
from keras.preprocessing.image import ImageDataGenerator;
from keras.preprocessing import image;
from keras.models import Model;
from keras.applications import imagenet_utils;
from keras.callbacks import ModelCheckpoint;
import tensorflow as tf;

When I'm training the model, at the end of the first epoch, I get the following error.

Epoch 1/50
60/60 [==============================] - ETA: 0s - loss: 0.6377 - accuracy: 0.6485
Segmentation fault: 11

Does anyone have any idea about how to solve this issue?

atw1020 commented 3 years ago

This is the same as #19. This error papers to be related to batch large batch size and reducing your batch size seems to help.