xuxianshan:

when I used dataloader in torch to output, I got this error: TypeError: ‘NoneType’ object is not subscriptable. I checked my dataset and it was complete. I dont know how to fix this error.


The error is self-explanatory. You are trying to subscript an object which you think is a list or dict, but actually is None  (i.e: the object has no value). This means that you tried to do:
None[something]
Here you attempted to index an object that doesn’t have that functionality. You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. This is a design principle for all mutable data structures in Python.
This ‘NoneType’ object is not subscriptable  is the one thrown by python when you use the square bracket notation object[key] where an object doesn’t define the getitem method.