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

AttributeError: module 'mindspore.dataset.vision' has no attribute 'RandomCropDecodeResize' #323

Open
bebopoy opened this issue Jan 7, 2025 · 0 comments

Comments

@bebopoy
Copy link

bebopoy commented Jan 7, 2025

'mindspore.dataset.vision' has no attribute 'RandomCropDecodeResize' ,Is it abandoned?and replaced with a new api?
but I can see it in https://www.mindspore.cn/docs/en/master/api_python/dataset_vision/mindspore.dataset.vision.RandomCropDecodeResize.html

Environment

Hardware Environment(Ascend/GPU/CPU):

/device ascend

华为云镜像:
mindspore1.7.0-cann5.1.0-py3.7-euler2.8.3
Ascend: 1*Ascend Snt9|ARM: 24核 96GB
已检测Ascend可调用

Software Environment:

  • MindSpore version (source or binary):

  • $pip show mindspore-ascend
    Name: mindspore-ascend
    Version: 1.7.0
    Summary: MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
    Home-page: https://www.mindspore.cn
    Author: The MindSpore Authors
    Author-email: [email protected]
    License: Apache 2.0
    Location: /home/ma-user/anaconda3/envs/MindSpore/lib/python3.7/site-packages
    Requires: asttokens, numpy, packaging, pillow, protobuf, psutil, scipy
    Required-by:

  • Python version (e.g., Python 3.7.5):

  • Python 3.7.10

  • OS platform and distribution (e.g., Linux Ubuntu 16.04):

  • 4.19.36-vhulk1907.1.0.h619.eulerosv2r8.aarch64

Describe the current behavior

AttributeError: module 'mindspore.dataset.vision' has no attribute 'RandomCropDecodeResize'


AttributeError Traceback (most recent call last)
in
10 config.max_epoch=4
11 config.device_target ="Ascend"
---> 12 run_train()

moxing_adapter.py in wrapped_func(*args, **kwargs)
108 run_func(*args, **kwargs)
109 # Upload data to train_url
110 if config.enable_modelarts:

run_train() in run_train()
164 if config.dataset == "garbage_photos":
165 dataset = resnet_create_dataset(config.data_dir, config.image_size, config.per_batch_size,
---> 166 config.rank, config.group_size)
167 val_dataset = resnet_create_dataset(config.data_dir, config.image_size, config.per_batch_size, config.rank, config.group_size, valid=True)
168

dataset.py in resnet_create_dataset(data_home, image_size, batch_size, rank_id, rank_size, training, valid)
43 shuffle=False, num_shards=rank_size, shard_id=rank_id)
44
---> 45 transform_img = vision.RandomCropDecodeResize([288,288], scale=(0.08, 1.0),
46 ratio=(0.75, 1.333)) # 改变尺寸
47 rescale = 1.0 / 255.0

AttributeError: module 'mindspore.dataset.vision' has no attribute 'RandomCropDecodeResize'

Describe the expected behavior

Steps to reproduce the issue

Related log / screenshot

Special notes for this issue

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

No branches or pull requests

1 participant