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
DQN does not allow custom models #6091
Comments
There's a bit of code below that check that auto wraps the default model in the interface. I'm open to auto wrapping custom models as well if you want to make a patch. Why not instead subclass the right model class though? It makes the behaviour a bit more clear I think: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_model.py#L59 |
@sytelus Hey I ran into this exact issue a few days back and all I subclassed the right Model and everything works as expected. `
|
But I think this should be implemented in the library by default. |
I see, that makes sense as I guess it's the expected behaviour. Cc @AmeerHajAli I think this would be a good issue to get started on if you're interested. |
Yeah, I think rllib shouldn't make distinction between built-in models and custom model. If it wraps up internal models then it should probably do so for custom models as well. |
That sounds good! |
System information
The following code tries to set built-in VisionNetwork from TF as custom model and it errors out as described below. However, the code succeeds if custom model was not set in which case exact same VisionNetwork gets selected automatically by _get_v2_model. The cause of this issue is explained below however I'm not sure about the fix.
Describe the problem
Current code in master is not allowing the use of custom models in DQN. When trying to use custom model (either for TF or PyTorch), error is thrown indicating that model has not been subclassed from
DistributionalQModel
. This happens even when custom model is set to simplyray.rllib.models.tf.visionnet_v2.VisionNetwork
.Error message:
Source code / logs
Cause of this issue is this check. Notice that this check is only done if custom_model is set. Apparently built-in models don't subclass
DistributionalQModel
either however as this check is not applied to built-in models they work fine.The text was updated successfully, but these errors were encountered: