Skip to content

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

Open
@LincanLi98

Description

@LincanLi98

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions