Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

resnet50.py - ImportError: attempted relative import with no known parent package (from . import get_submodules_from_kwargs) #180

Open
Sushmasrini2016 opened this issue Apr 11, 2020 · 1 comment

Comments

@Sushmasrini2016
Copy link

Hi Team,

While i'm running "resnet50.py" i'm getting the below error. please assist us.

$PWD
/opt/anaconda3/envs/cnn/lib/python3.7/site-packages/keras_applications
$python resnet50.py
Traceback (most recent call last):
File "resnet50.py", line 17, in
from . import get_submodules_from_kwargs
ImportError: attempted relative import with no known parent package

Thank you,

@iyashdesh
Copy link

try
from keras_applications import get_submodules_from_kwargs
from keras_applications import imagenet_utils
from keras_applications.imagenet_utils import decode_predictions
from keras_applications.imagenet_utils import _obtain_input_shape

if explicitly using the code for a keras application then you might get this error:
AttributeError: 'NoneType' object has no attribute 'image_data_format'
so try this:
http://donghao.org/2019/02/22/using-resnext-in-keras-2-2-4/

good luck

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants