UOB-AI / UOB-AI.github.io

A repository to host our documentations website.
https://UOB-AI.github.io
1 stars 3 forks source link

import torchvision #30

Closed Amalsalem closed 1 year ago

Amalsalem commented 1 year ago

i have problem in importing

import torchvision

i get this error:


ImportError Traceback (most recent call last) Cell In[7], line 1 ----> 1 import torchvision 2 import torchvision.transforms as transforms 4 # Set the root directory for dataset storage

File ~/.local/lib/python3.9/site-packages/torchvision/init.py:5 2 import warnings 4 import torch ----> 5 from torchvision import datasets, io, models, ops, transforms, utils 7 from .extension import _HAS_OPS 9 try:

ImportError: cannot import name 'datasets' from partially initialized module 'torchvision' (most likely due to a circular import) (/home/nfs/20015279/.local/lib/python3.9/site-packages/torchvision/init.py)

image

asubah commented 1 year ago

torchvision is already installed in the Conda base environment, you don't need to install it locally. Your local installation is causing the problem. Try:

pip uninstall torchvision
Amalsalem commented 1 year ago

the notebooks do not support direct user input during runtime. how can i do it and from the shell : i tried this conda uninstall torchvision

i get this:

Preparing transaction: done Verifying transaction: failed EnvironmentNotWritableError: The current user does not have write permissions to the target environment. environment location: /data/software/miniconda3 uid: 1341 gid: 952

On Sat, May 20, 2023 at 10:43 PM Abdulla Subah @.***> wrote:

torchvision is already installed in the Conda base environment, you don't need to install it locally. Your local installation is causing the problem. Try:

pip uninstall torchvision

— Reply to this email directly, view it on GitHub https://github.com/UOB-AI/UOB-AI.github.io/issues/30#issuecomment-1555979823, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY3B76HNAKXJXNWKI5OUYDDXHENEXANCNFSM6AAAAAAYI2OWW4 . You are receiving this because you authored the thread.Message ID: @.***>

asubah commented 1 year ago

pip uninstall not conda uninstall, if pip doesn't exist do conda activate before using pip.

From the notebook you can do

! pip uninstall torchvision
Amalsalem commented 1 year ago

notebook donot support input user .. right ? i mean what cani do if it ask (Y/N) ,,, how can i enter Y

[image: image.png]

On Sun, May 21, 2023 at 12:44 AM Abdulla Subah @.***> wrote:

pip uninstall not conda uninstall, if pip doesn't exist do conda activate before using pip.

From the notebook you can do

! pip uninstall torchvision

— Reply to this email directly, view it on GitHub https://github.com/UOB-AI/UOB-AI.github.io/issues/30#issuecomment-1556020357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY3B76BTH4WRNEPSQAIABJTXHE3NHANCNFSM6AAAAAAYI2OWW4 . You are receiving this because you authored the thread.Message ID: @.***>

asubah commented 1 year ago

You can give it the option -y to accept the confirmation prompt.

! pip uninstall -y torchvision
Amalsalem commented 1 year ago

yes ..it works.. thanks

On Sun, May 21, 2023 at 1:44 AM Abdulla Subah @.***> wrote:

You can give it the option -y to accept the confirmation prompt.

! pip uninstall -y torchvision

— Reply to this email directly, view it on GitHub https://github.com/UOB-AI/UOB-AI.github.io/issues/30#issuecomment-1556034274, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY3B76CGK76MVOQWMJT4F3DXHFCLXANCNFSM6AAAAAAYI2OWW4 . You are receiving this because you authored the thread.Message ID: @.***>

Amalsalem commented 1 year ago

thanks