Potential bug in ParameterDict get from shared dict #13919
Replies: 3 comments
-
|
Hey, this is the MXNet Label Bot. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @meissnereric Thanks for posting this. This seems like a question to me and this can get more attention on the MXNet discussion forum (https://discuss.mxnet.io), where it will get a wider audience and allow others to learn as well. @mxnet-label-bot add [Question, Gluon] |
Beta Was this translation helpful? Give feedback.
-
|
Hey Piyush, Sure I'm happy to post this on the forum as well as it probably does need some sort of discussion, but I do think its more than a misunderstanding so can we leave the issue open until the discussion resolves? Thanks, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The Gluon Block's collect_param method does not surface the parameters of "shared" ParameterDicts and we need this functionality for some other work.
I think this is a bug in the implementation of the ParameterDict class's getitem functionality, but I definitely could be missing something. The
getmethod looks in the shared dict, but the___getitem___method doesn't, and the___getitem___is what the Gluon Block'scollect_params method uses. I don't need it to add items to the shared dict, just for them to show up when I loop through the overall ParameterDict.Environment info (Required)
Minimum reproducible example
(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)
Running this, I would expect it to output the
aparameter, but instead it outputs just an empty parameter dictionary because collect_params doesn't look inside the shared param_dict.What have you tried to solve it?
To unblock temporarily, we're just using a workaround in our code and just manually overriding the
_paramsof the Block with the correct ParameterDict, but that's not a real option even in the short term. The obvious solution I see would be to make__getitem__also loop over the shared ParameterDict's item's but I don't know what issues that might cause elsewhere.Beta Was this translation helpful? Give feedback.
All reactions