Skip to content

'NoneType' object is not subscriptable when TensorboardLogger handler is EPOCH_COMPLETED #3325

Answered by vfdev-5
Roy-Kid asked this question in Q&A
Discussion options

You must be logged in to vote

The problem is related to this line:

self.state.batch = self.state.output = None
and the fact that the input train_dl does not have the length, so we accidentaly remove state.batch and state.output to estimate self.epoch_length.
To make it work you can run your code with specified epoch_length

trainer.run(
    train_dl, max_epochs=2, epoch_length=10,
)

This behaviour seems like a bug to me.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@Roy-Kid
Comment options

@Roy-Kid
Comment options

@vfdev-5
Comment options

@vfdev-5
Comment options

Answer selected by Roy-Kid
@Roy-Kid
Comment options

@vfdev-5
Comment options

@Roy-Kid
Comment options

@vfdev-5
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants