Skip to content

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

@xkluan

Description

@xkluan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions