Could you add some debug statements to your code and check, if the model variable was replaced somewhere?
model = MyNet()
print(model)
[...]
print(model)
output = model(dataset)

I guess that model was initially a valid object, but might have been replaced accidentally with None.