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

'No loss found. You may have forgotten to provide a loss argument ' #114

Open
xkluan opened this issue Aug 4, 2022 · 0 comments
Open

'No loss found. You may have forgotten to provide a loss argument ' #114

xkluan opened this issue Aug 4, 2022 · 0 comments

Comments

@xkluan
Copy link

xkluan commented Aug 4, 2022

When I test the getting-started on https://colab.research.google.com/github/kipoi/kipoiseq/blob/master/notebooks/getting-started.ipynb . I found that the run the cell "model.fit_generator(iterator, steps_per_epoch=len(dl)//batch_size, epochs=10)", there is an error occured. That said as below:

ValueError: in user code:

File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function  *
    return step_function(self, iterator)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1010, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1000, in run_step  **
    outputs = model.train_step(data)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 861, in train_step
    self._validate_target_and_loss(y, loss)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 828, in _validate_target_and_loss
    'No loss found. You may have forgotten to provide a `loss` argument '

ValueError: No loss found. You may have forgotten to provide a `loss` argument in the `compile()` method. 

However, I have set the loss parameter in model.compile function:
model.compile(optimizer = 'adam', loss = ['binary_crossentropy'], metrics = ['acc'])

I want to know why this will happen.

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

1 participant