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

ANTsPyNet installation error: Tensorflow not found #49

Closed
hegde00 opened this issue Mar 3, 2022 · 6 comments
Closed

ANTsPyNet installation error: Tensorflow not found #49

hegde00 opened this issue Mar 3, 2022 · 6 comments

Comments

@hegde00
Copy link

hegde00 commented Mar 3, 2022

Hi Everyone,

I'm trying to install ANTsPyNet using the instructions in https://github.com/ANTsX/ANTsPyNet.

Everything seemed to go well (please see the attached log), except that the final command generates a "tensorflow distribution not found" error as follows:

jay@Euler:/ANTsPyNet$ sudo python3 setup.py install
...
...
Installed /usr/local/lib/python3.8/dist-packages/tfp_nightly-0.2.0.dev20220302-py3.8.egg
error: The 'tensorflow' distribution was not found and is required by antspynet
jay@Euler:
/ANTsPyNet$

Can you please help? Thank you!
Jay

ANTsPyNet_installation_log_JayHegde.txt

@ntustison
Copy link
Member

What happens when you actually try to import ANTsPy and ANTsPyNet?

>>> import ants
>>> import antspynet

@hegde00
Copy link
Author

hegde00 commented Mar 3, 2022

HI Nick,

I ran your suggested commands from my Python3 prompt (I assumed this is what you meant, judging from the prompt sign). Here's what I got:

import ants #Seems to have worked fine.
import antspynet
2022-03-03 07:57:29.305885: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-03-03 07:57:29.305925: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Thanks,
Jay

@ntustison
Copy link
Member

Okay, those errors are probably fine. If you do have a GPU available for processing, you'll have to set it up separately. For now, try a t1-w brain extraction---

>>> import ants
>>> import antspynet
>>> t1 = ants.image_read(antspynet.get_antsxnet_data("kirby"))
>>> mask = antspynet.brain_extraction(t1, modality="t1", verbose=True)

@hegde00
Copy link
Author

hegde00 commented Mar 3, 2022

I think it worked! Please see below. Thank you very much, Nick! So may I assume that ANTsPyNet is set up correctly on my machine and proceed accordingly? (I'll look into setting up my GPU (I do have an NVIDIA graphics card on this machine).

Jay

import ants
import antspynet
t1 = ants.image_read(antspynet.get_antsxnet_data("kirby"))
Downloading data from https://ndownloader.figshare.com/files/25620107
39452672/39448573 [==============================] - 78s 2us/step
39460864/39448573 [==============================] - 78s 2us/step
mask = antspynet.brain_extraction(t1, modality="t1", verbose=True)
Brain extraction: retrieving model weights.
...
Brain extraction: normalizing image to the template.
Brain extraction: prediction and decoding.
1/1 [==============================] - 2s 2s/step
Brain extraction: renormalize probability mask to native space.
mask
ANTsImage (LAI)
Pixel Type : float (float32)
Components : 1
Dimensions : (170, 256, 256)
Spacing : (1.2, 1.0, 1.0)
Origin : (202.8, 0.0, 0.0)
Direction : [-1. 0. 0. 0. 1. 0. 0. 0. 1.]

@ntustison
Copy link
Member

So may I assume that ANTsPyNet is set up correctly on my machine and proceed accordingly?

It appears to be.

(I'll look into setting up my GPU (I do have an NVIDIA graphics card on this machine).

Unless you're training models, this is probably not of significant priority. All of the processing I do on the university cluster doesn't utilize the GPUs as CPU-based processing is sufficiently fast and the number of CPU units >> number of GPU units.

@hegde00
Copy link
Author

hegde00 commented Mar 3, 2022

Thank you very much. I greatly appreciate it. Please consider this issue resolved then.

@hegde00 hegde00 closed this as completed Mar 3, 2022
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