Search code examples
pythontensorflowmachine-learningkerasgoogle-colaboratory

Tensorflow.keras not training and stoping with error 'No algorithm worked!' in Colab


I created a CNN model and it trained properly for the first and completed all epochs but when I closed the runtime and came back after a day and tried to retrain. It gives this error.

NotFoundError:  No algorithm worked!
 [[node sequential_2/conv2d_4/Conv2D (defined at <ipython-input-7-5d7257468056>:45) ]] [Op:__inference_train_function_3464]

Note: I am training this in google colab Here's the error code.

model.compile(optimizer='adam' , loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(train_dataset,batch_size=16,epochs=40,verbrose = 1,
         validation_data=val_data,validation_steps = 16 
         ,shuffle=True, steps_per_epoch=80,
         use_multiprocessing=False,callbacks=[callbacks])
model.save('/content/drive/My Drive/eyes2.h5')
model.summary()

Link to notebook https://colab.research.google.com/drive/1Qf05-Axd1gjuZhBDv7LwNtO_znIg4iKf


Solution

  • Try downgrading tensorflow to 1.x. Recently colab has updated tensorflow from 1.x to 2.x as its default which might be leading to this error. .