BloodAxe / pytorch-toolbelt

PyTorch extensions for fast R&D prototyping and Kaggle farming
MIT License
1.51k stars 119 forks source link

I faced AttributeError: can't set attribute 'channels' #94

Closed DShomin closed 1 year ago

DShomin commented 1 year ago

🐛 Bug

When I used pytorch_toolbelt.modules.decoders.FPNCatDecoder I got AttributeError.

think there is a duplicate usage of the "channel" variable in the FPNCatDecoder object, which is causing an error. As a solution, I renamed the channel variable used in FPNCatDecoder to "channel_o," and it executed without any issues. The potential location of the variable duplication seems to be in the channel variable of the DecoderModule.

BloodAxe commented 1 year ago

Hi. There is a @property attribute with this name. That's why you're getting this error I beleive. Btw, this is about to change in the next major release. A new API will provide a get_output_spec() method for all encoders/decoders/heads modules: https://github.com/BloodAxe/pytorch-toolbelt/blob/develop/pytorch_toolbelt/modules/interfaces.py#L22 This should make querying a module of it's output specification more easy and less error-prone.

DShomin commented 1 year ago

Oh good thx, so when will it update??