Closed annahambi closed 2 years ago
You might have to name your class "Model" instead of "Custom_VGG", but I think your issue is unrelated to that. Seems to be a parsing issue when using the mod = importlib.util.module_from_spec(spec)
function. Perhaps inspecting the mod
object will help see if there is something in your script that cannot be properly parsed.
I have done as you suggested and renamed my class to "Model" instead of "Custom_VGG". As you suspected already, the error message stayed the same.
Can you give me a hint on how I can inspect the mod
object? I have no idea how such an inspection works : P
If you are using an IDE like PyCharm or Spyder, you can use the debug function to set a breakpoint and look at the contents of mod. Otherwise you can insert a print statement, for instance print(mod.__dict__)
. I won't be able to further help much with the debugging though. If all fails you might want to consider setting up your network in Keras instead of Pytorch to avoid this error. You could test with dummy weights first if the parsing goes through using Keras.
I am trying to convert a VGG16 model (loaded from the PyTorch models, however modified to be trained on CIFAR10) to an SNN. When I run the conversion, the import script generates a "ValueError: source code string cannot contain null bytes".
Full Error Message
Generate VGG16 via
Custom class