ImageAI icon indicating copy to clipboard operation
ImageAI copied to clipboard

Getting keras error while trying to continue model training

Open AnzeVersnik opened this issue 3 years ago • 1 comments

This is the error I get

Traceback (most recent call last): File "prediction.py", line 6, in model_trainer.trainModel(num_objects=4, num_experiments=4, enhance_data=True, batch_size=32, show_network_summary=True,transfer_from_model="model_ex-002_acc-0.965413.h5", initial_num_objects=4) File "C:\Anacodnda\lib\site-packages\imageai\Classification\Custom_init_.py", line 224, in trainModel base_model = tf.keras.applications.ResNet50(input_shape=(training_image_size, training_image_size, 3), weights= transfer_from_model, File "C:\Anacodnda\lib\site-packages\tensorflow\python\keras\applications\resnet.py", line 474, in ResNet50 return ResNet(stack_fn, False, True, 'resnet50', include_top, weights, File "C:\Anacodnda\lib\site-packages\tensorflow\python\keras\applications\resnet.py", line 141, in ResNet raise ValueError('The weights argument should be either ' ValueError: The weights argument should be either None (random initialization), imagenet (pre-training on ImageNet), or the path to the weights file to be loaded.

AnzeVersnik avatar Oct 18 '21 09:10 AnzeVersnik

Hi, @AnzeVersnik One tip, always add the code you have run when got the error thy. Your weight path seems to be false, it should point to a .h5 file from the model you want to continue training on

ekesdf avatar Nov 01 '21 16:11 ekesdf