Hoda Fakharzadeh Hoda Fakharzadeh - 1 year ago 115
Python Question

from ..layers import Input SystemError: Parent module '' not loaded, cannot perform relative import

I'm trying to run resnet50.py from keras.applications but i get this error:

from ..layers import Input
SystemError: Parent module '' not loaded, cannot perform relative import


pls tell me how to fix it?

Answer Source

It appears that resnet50.py is a part of the keras package and is not meant to be run as a standalone script by itself.

I would recommend importing the relevant classes from the resnet50 package. For example, you could do something like:

from keras.applications.resnet50 import ResNet50

resnet = ResNet50(...)

Of course, you would need to install keras first.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download