Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted relative import beyond toplevel package #47

Open
chentao2016 opened this issue Sep 7, 2018 · 2 comments
Open

Attempted relative import beyond toplevel package #47

chentao2016 opened this issue Sep 7, 2018 · 2 comments

Comments

@chentao2016
Copy link

hi,when i try to run the code ,i have the ValueError: Attempted relative import beyond toplevel package.I cannot find the reason.
File "../../models/fcn16s.py ", line 5, in
from ..utils import get_upsampling_weight
ValueError: Attempted relative import beyond toplevel package

@mariaka
Copy link

mariaka commented Sep 11, 2018

Hi! What helped me was to add
import sys sys.path.insert(0, '/absolute/path/to/your/project/folder')

at the top of the file and then changing the utils import to

from utils.misc import get_upsampling_weight . You can also add the import sys part to the init.py file. Hope it resolves your issue, too!

@gasparramoa
Copy link

Hi! What helped me was to add
import sys sys.path.insert(0, '/absolute/path/to/your/project/folder')

at the top of the file and then changing the utils import to

from utils.misc import get_upsampling_weight . You can also add the import sys part to the init.py file. Hope it resolves your issue, too!

It work for me, just modify all the files fcn16s.py, fcn32s.py, ... etc

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

No branches or pull requests

3 participants