Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: You must compile your model before using it. #34

Open
phyukhaing7 opened this issue Oct 11, 2018 · 4 comments
Open

RuntimeError: You must compile your model before using it. #34

phyukhaing7 opened this issue Oct 11, 2018 · 4 comments

Comments

@phyukhaing7
Copy link

Running prepare_dataset.py is okay.
When I run test_model.py, I found the following error.
How should I change code? Please guide me!

C:\Anaconda3\envs\caption_generator-master\python.exe
D:/code/Python/caption_generator-master/caption_generator/train_model.py
Using TensorFlow backend.
Total samples : 383454
Vocabulary size: 8256
Maximum caption length: 40
Variables initialization done!
Model created!
Traceback (most recent call last):
File "D:/Python/caption_generator-master/caption_generator/train_model.py", line 26, in
train_model(epochs=50)
File "D:/code/Python/caption_generator-master/caption_generator/train_model.py", line 17, in train_model
model.fit_generator(cg.data_generator(batch_size=batch_size), steps_per_epoch=cg.total_samples/batch_size, epochs=epochs, verbose=2, callbacks=callbacks_list)
File "C:\Anaconda3\envs\caption_generator-master\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Anaconda3\envs\caption_generator-master\lib\site-packages\keras\engine\training.py", line 1420, in fit_generator
initial_epoch=initial_epoch)
File "C:\Anaconda3\envs\caption_generator-master\lib\site-packages\keras\engine\training_generator.py", line 40, in fit_generator
model._make_train_function()
File "C:\Anaconda3\envs\caption_generator-master\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.

Process finished with exit code 1

@DuYawei512
Copy link

Excuse me, have you solved this problem?

@rohith-vishnu
Copy link

does anyone have a solution to this ?

@Chitransh31
Copy link

Has anyone solved this problem?Please help

@uguisu
Copy link

uguisu commented Jun 9, 2019

I'm facing the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants