You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
Currently there is a bug in the way Optimizer is trying to serialize state which fails when trying to deserialize Optimizer that has no states (like SGD without momentum).
Issue
Currently the way serialize is being done is as below: (pasting Optimizer.serailizeState())
When an Optimizer without states like SGD with momentum set as 0 is being used. The states map (Map[Int, AnyRef]) contains a (key, value) pair as (some integer index, null).
The above serialize method does not write k as the value of key and 0 as the value of stateBytes, due to the null check if (v != null)
Now while deserializing: (Pasting code from Optimizer.deserializeState())
Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Scala, Bug
Hey @satyakrishnagorti, it sounds like you have looked at this and know what to change. If you are interested, you are also more than welcome to open a pull request and contribute the fixes yourself. Let me know if you need any help
Description
Currently there is a bug in the way Optimizer is trying to serialize state which fails when trying to deserialize Optimizer that has no
states
(like SGD without momentum).Issue
Currently the way serialize is being done is as below: (pasting Optimizer.serailizeState())
When an Optimizer without
states
like SGD with momentum set as0
is being used. Thestates
map (Map[Int, AnyRef]
) contains a (key, value) pair as (some integer index
,null
).The above serialize method does not write
k
as the value ofkey
and0
as the value ofstateBytes
, due to the null checkif (v != null)
Now while deserializing: (Pasting code from Optimizer.deserializeState())
In the
foreach
loop, the key is being read (which wasn't serialized previously) hence, this would cause anjava.io.EOFException
.Solution.
Get rid of
if (v != null)
check and retain the rest.The text was updated successfully, but these errors were encountered: