Image-Captioning icon indicating copy to clipboard operation
Image-Captioning copied to clipboard

raise RuntimeError('You must compile your model before using it.')

Open Shanzaay opened this issue 5 years ago • 1 comments

Hey when i try to train the model i am getting the following error:

Using TensorFlow backend. 413439 WARNING:tensorflow:From C:\Users\UserName\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. Model created! Traceback (most recent call last): File "D:\Image-caption\Image-Captioning-master\train.py", line 14, in train(int(sys.argv[1])) File "D:\Image-caption\Image-Captioning-master\train.py", line 9, in train model.fit_generator(sd.data_process(batch_size=batch_size), steps_per_epoch=sd.no_samples/batch_size, epochs=epoch, verbose=2, callbacks=None) File "C:\Users\UserName\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "C:\Users\UserName\Anaconda3\lib\site-packages\keras\engine\training.py", line 1418, in fit_generator initial_epoch=initial_epoch) File "C:\Users\UserName\Anaconda3\lib\site-packages\keras\engine\training_generator.py", line 40, in fit_generator model._make_train_function() File "C:\Users\UserName\Anaconda3\lib\site-packages\keras\engine\training.py", line 496, in _make_train_function raise RuntimeError('You must compile your model before using it.') RuntimeError: You must compile your model before using it.

I am trying to solve it but getting no luck. Its been 2 weeks since i am stuck on the problem. Please help me out here.

Shanzaay avatar Oct 16 '19 06:10 Shanzaay

when create the model, you should set ret_model=False

haoyudong-97 avatar Oct 28 '19 14:10 haoyudong-97