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

Can I run assignment3 locally? #4

Closed
ge1mina023 opened this issue Mar 31, 2023 · 7 comments
Closed

Can I run assignment3 locally? #4

ge1mina023 opened this issue Mar 31, 2023 · 7 comments
Labels
question Further information is requested

Comments

@ge1mina023
Copy link

Using my MacBook Pro M1

@mantasu
Copy link
Owner

mantasu commented Mar 31, 2023

Yes, you will need GPU acceleration which is supported by PyTorch for M1 chips as well. You can install PyTorch by following this guide https://developer.apple.com/metal/pytorch/. Then just install the requirements:

pip install -r assignment3/requirements.txt

@ge1mina023
Copy link
Author

thanks~

@ge1mina023
Copy link
Author

What should I do additionally? Only comment out the code about google colab?

@mantasu mantasu added the question Further information is requested label Mar 31, 2023
@mantasu
Copy link
Owner

mantasu commented Mar 31, 2023

You should also do the following changes in the files that actually use GPU acceleration:

  1. In Generative_Adversarial_Networks.ipynb, whenever .type(dtype) is called, change that to .to(device="mps")
  2. In Self_Supervised_Learning.ipynb change the final line in the 4th code cell:
    # device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    device = torch.device("mps" if torch.backends.mps.is_available() else "cpu")

@ge1mina023
Copy link
Author

Is that all I need to do?

@mantasu
Copy link
Owner

mantasu commented Apr 1, 2023

I can't confirm since I don't have Apple M1. It should be all but if you encounter any issues let me know.

@ge1mina023
Copy link
Author

I can't confirm since I don't have Apple M1. It should be all but if you encounter any issues let me know.

thanks a lot~

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

No branches or pull requests

2 participants