Intel® DevCloud
Help for those needing help starting or connecting to the Intel® DevCloud
1723 Discussions

not able to import torch when connected to IntelDevCloud using Jupyter notebook

idata
Employee
4,357 Views

Please help me regarding how to import torch

0 Kudos
8 Replies
idata
Employee
2,819 Views

Hello,

 

 

Thanks for reaching out to us.

 

 

First create a virtual environment using the below command

 

conda create -n -c intel python=2 pip numpy source activate

 

 

Command to install pytorch

 

conda install pytorch-cpu torchvision -c pytorch

 

 

Go to python shell and import using the command

 

import torch  Thanks, Dilraj
0 Kudos
idata
Employee
2,819 Views

Thanks for the guide line....but will you please make it clear where (which prompt) to form the virtual environment

0 Kudos
idata
Employee
2,819 Views

Hello,

 

 

In the terminal please give the below command

 

 

conda create -n Vaidehi -c intel python=2 pip numpy  Virtual Name : Vaidehi  Thanks, Dilraj
0 Kudos
idata
Employee
2,819 Views

Thank you!!! it worked...

0 Kudos
idata
Employee
2,819 Views

I could instal pytorch using steps you gave.

But import torch still did not work in jupyter notebook, it worked though on python shell accessed under virtual environment

one more doubt regarding jupyter:

how to save and submit script file prepared using jupyter ?

0 Kudos
idata
Employee
2,819 Views

Hello,

 

 

Please find the details

 

 

source activate  conda install ipykernel ipython kernel install --name --user

 

 

Once this is done, launch your python code from hub.colfaxresearch.com

 

Select Kernel -> Change Kernel ->

 

 

Do try out and check if this works!

 

 

Thanks,

 

Dilraj
0 Kudos
idata
Employee
2,819 Views

Hello,

 

 

We did not receive any response, so we are closing the case for now.

 

 

Thanks,

 

Dilraj
0 Kudos
idata
Employee
2,819 Views

Thanks, it worked....it didn't give me any error when i imported pytorch from jupyter notebook

0 Kudos
Reply