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

has no attribute 'get_sampling_map' #7

Closed
shuochen365 opened this issue Nov 6, 2020 · 9 comments
Closed

has no attribute 'get_sampling_map' #7

shuochen365 opened this issue Nov 6, 2020 · 9 comments

Comments

@shuochen365
Copy link

Hi,
Thank you very much for sharing your code. But when I run your code, the following error occurs:

/FreeViewSynthesis/exp/dataset.py", line 165, in base_getitem
sampling_maps, valid_depth_masks, valid_map_masks = ext.preprocess.get_sampling_map(
AttributeError: module 'ext.preprocess' has no attribute 'get_sampling_map'

Hope you can help answer, thank you.

@griegler
Copy link
Contributor

griegler commented Nov 6, 2020

Did you compile the Python extension as outlined in the readme?

cd ext/preprocess
cmake -DCMAKE_BUILD_TYPE=Release .
make 

@shuochen365
Copy link
Author

yes,I have

[100%] Linking CXX shared module preprocess.cpython-38-x86_64-linux-gnu.so
[100%] Built target preprocess

@griegler
Copy link
Contributor

griegler commented Nov 6, 2020

What happens if you run python -c 'import preprocess' or python -c 'import preprocess; dir(preprocess)' in ext/preprocess?

@shuochen365
Copy link
Author

/ext/preprocess$ python -c 'import preprocess; dir(preprocess)'
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'preprocess'

@griegler
Copy link
Contributor

griegler commented Nov 6, 2020

That indicates that the extension has not been properly build. Maybe you are using a different Python version for building and running?

@shuochen365
Copy link
Author

How much Python do you use ? I use python 3.7.9

@griegler
Copy link
Contributor

griegler commented Nov 6, 2020

So python --version returns 3.7.9? Given your previous posting

[100%] Linking CXX shared module preprocess.cpython-38-x86_64-linux-gnu.so
[100%] Built target preprocess

you used Python 3.8 for building the extension. You might need to change the Python interpreter that cmake is using.

@shuochen365
Copy link
Author

Ok, I will try again. Thank you very much.

@shuochen365
Copy link
Author

Thank you very much for your kind answer. My problem has been solved.

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

2 participants