Azure / Azure/MachineLearningNotebooks

ml-frameworks/using-mlflow/train-and-deploy-pytorch fails due incompatible torchvision

Đang mở
#1,425 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
ADO AML Compute Instance MLOps product-issue
Ngôn ngữ chính
Jupyter Notebook
Star
4.4k
Fork
2.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm running https://github.com/Azure/MachineLearningNotebooks/tree/824d844cd7386d95edfa6ecec1642e799ca79dd7/how-to-use-azureml/ml-frameworks/using-mlflow/train-and-deploy-pytorch on a default compute instance with "Python 3.8 AzureML" kernel.

The following cell fails
```python
lib_path = os.path.abspath("scripts")
sys.path.append(lib_path)

import train
```

with

```python
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in
2 sys.path.append(lib_path)
3
----> 4 import train

/mnt/batch/tasks/shared/LS_root/mounts/clusters/notebook142298/code/how-to-use-azureml/ml-frameworks/using-mlflow/train-and-deploy-pytorch/scripts/train.py in
15 import torch.nn.functional as F
16 import torch.optim as optim
---> 17 import torchvision
18 from torchvision import datasets, transforms
19

/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torchvision/__init__.py in
2
3 from torchvision import models
----> 4 from torchvision import datasets
5 from torchvision import ops
6 from torchvision import transforms

/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torchvision/datasets/__init__.py in
----> 1 from .lsun import LSUN, LSUNClass
2 from .folder import ImageFolder, DatasetFolder
3 from .coco import CocoCaptions, CocoDetection
4 from .cifar import CIFAR10, CIFAR100
5 from .stl10 import STL10

/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torchvision/datasets/lsun.py in
17 import pickle
18
---> 19 from .utils import verify_str_arg, iterable_to_str
20
21

/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torchvision/datasets/utils.py in
9 import torch
10 from torch.utils.model_zoo import tqdm
---> 11 from torch._six import PY3
12
13

ImportError: cannot import name 'PY3' from 'torch._six' (/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torch/_six.py)
```

![Screenshot from 2021-04-09 17-07-33](https://user-images.githubusercontent.com/3178318/114201060-1c8a6080-9956-11eb-82a6-1461d803ca4a.png)

The conda azureml_py38 environment has the following:

![Screenshot from 2021-04-09 17-13-22](https://user-images.githubusercontent.com/3178318/114211176-9aec0000-9960-11eb-8edc-891292760ec8.png)

Related to https://github.com/pytorch/vision/issues/1780

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.