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

ImportError: cannot import name 'DataSetIter' from 'fastNLP' 似乎无法调用DataSetIter和BatchIter,其他模块都可以正常调用 #452

Open
LincanLi98 opened this issue Mar 11, 2023 · 1 comment

Comments

@LincanLi98
Copy link

Describe the bug
环境为Anaconda+python3.8, fastNLP版本为1.0.1,可以正常调用其他模块,但无法调用DataSetIter和BatchIter模块。描述如下:

File "./stock_energy/aegan.py", line 10, in
from fastNLP import DataSet, DataSetIter, RandomSampler, SequentialSampler
ImportError: cannot import name 'DataSetIter' from 'fastNLP' (/Users/mac/opt/anaconda3/lib/python3.8/site-packages/fastNLP/init.py)

Python 3.8.3 (default, Jul 2 2020, 11:26:31)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

from fastNLP import DataSet
from fastNLP import RandomSampler
from fastNLP import SequentialSampler
from fastNLP import DataSetIter
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'DataSetIter' from 'fastNLP' (/Users/mac/opt/anaconda3/lib/python3.8/site-packages/fastNLP/init.py)
import fastNLP
print(fastNLP.version)
1.0.1

@x54-729
Copy link
Collaborator

x54-729 commented Mar 11, 2023

您好!新版本的 fastNLP 删除了 DataSetIter 和 BatchIter 模块,您可以查看我们最新版本的文档 DataLoader 的用法,或者安装旧版本(0.7.0 0.6.0等)来继续使用这两个模块

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

2 participants