module 'torchtext.data' has no attribute 'TabularDataset'
时间: 2023-09-23 07:07:07 浏览: 65
This error occurs when you are trying to use the `TabularDataset` class from the `torchtext.data` module, but it is not available in your version of TorchText.
`TabularDataset` was introduced in TorchText version 0.2.3, so if you are using an older version of TorchText, you may encounter this error. To fix this, you can upgrade your version of TorchText by running:
```
pip install --upgrade torchtext
```
If you are already using the latest version of TorchText and still encountering this error, you can try importing `TabularDataset` from the `torchtext.datasets` module instead:
```
from torchtext.datasets import TabularDataset
```
This should resolve the issue.