-
Notifications
You must be signed in to change notification settings - Fork 11
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
Question on running the model on mac #26
Comments
I’m currently trying to run the model locally on macOS. The code uses many functions that call CUDA-specific GPU operations, which Mac OS doesn’t have. Each error of the type 'torch using cuda unable' specifies which .py file in the project is calling CUDA. The aim is to modify these folder so that it doesn't use CUDA but instead uses the macOS CPU. Chat gpt helps easily on this Ex in BiomedParse]/inference_examples_DICOM, instead of : model = BaseModel(opt, build_model(opt)).from_pretrained(pretrained_pth).eval().cuda() use : device = 'cuda' if torch.cuda.is_available() else 'cpu' model = BaseModel(opt, build_model(opt, device=device)) model = model.from_pretrained(pretrained_pth).eval() model.to(device) |
You also have to replace:
|
Thanks for the solutions provided in the thread! We developed the model on Linux with CUDA GPUs and never tried MacOS. Let me know if these solutions work for you. |
Dear authors,
Thank you for creating this invaluable resource and for making it open source!
I am currently trying to run the example prediction script and jupyter notebook on my mac however I keep getting errors when I run the section to load the model weights.
Here is what it prints out:
Deformable Transformer Encoder is not available.
hostname: illegal option -- I
usage: hostname [-f] [-s | -d] [name-of-host]
Here is the error:
CalledProcessError: Command '['hostname -I']' returned non-zero exit status 1.
I managed to get it to work on google collab but I would like to use it locally therefore I was wondering whether the model must use GPU in order for it to run. If not, could you direct me to the places where I can change for it to work on CPU.
Thank you!
The text was updated successfully, but these errors were encountered: