agnews_train, agnews_test = torchtext.datasets.text_classification.DATASETS["AG_NEWS"](root="./datasets")运行以上行后,我将得到属性错误。
在->1 torchtext.datasets.text_classification.DATASETS"AG_NEWS“,agnews_test = AttributeError中,AttributeError跟踪(最近一次调用)
AttributeError:模块“torchtext.datasets”没有属性“text_classification”
发布于 2021-06-09 06:58:13
您可能只是在使用不同的版本。你想要的是:
agnews_train, agnews_test = torchtext.datasets.AG_NEWS(root='./datasets', split=('train', 'test'))https://stackoverflow.com/questions/67898963
复制相似问题