Open keremnymn opened 1 year ago
Hi, I have encountered the same problem as yours, did you solve it now?
Updates?
torch.version = 2.1.0+cpu torchtext.version = 0.16.0+cpu sys.version= 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
now no such error: 'NoneType' object has no attribute 'Lock'
I resolved this in torchtext 0.16.0 by installing portalocker==2.8.2
and then restarting the kernel of my Jupyter notebook.
IMO portalocker should be an explicity dependency, as in #2182.
I just tried using this tutorial https://pytorch.org/text/stable/tutorials/sst2_classification_non_distributed.html#data-transformation
AttributeError Traceback (most recent call last)
75 frames /usr/local/lib/python3.10/dist-packages/torchdata/datapipes/iter/util/cacheholder.py in _cache_check_fn(data, filepath_fn, hash_dict, hash_type, extra_check_fn, cache_uuid) 261 os.makedirs(dirname) 262 --> 263 with portalocker.Lock(promise_filepath, "a+", flags=portalocker.LockFlags.EXCLUSIVE) as promise_fh: 264 promise_fh.seek(0) 265 data = promise_fh.read()
AttributeError: 'NoneType' object has no attribute 'Lock' This exception is thrown by iter of _MemoryCellIterDataPipe(remember_elements=1000, source_datapipe=_ChildDataPipe)
Tried restarting kernel did'nt work!
🐛 Bug
Describe the bug A clear and concise description of what the bug is.
Looping through the data that was split gives
AttributeError: 'NoneType' object has no attribute 'Lock' This exception is thrown by __iter__ of _MemoryCellIterDataPipe(remember_elements=1000, source_datapipe=_ChildDataPipe)
To Reproduce Steps to reproduce the behavior:
You can try to execute the function from the official documentation, which is on this page:
torch==2.0.1+cpu
pip
3.11
0.15.2
portalocker>=2.0.0
otherwise it was giving an error telling me to install this package.I tried both on my local environment and Google Colab. Same error.