Skip to content

TypeError: img should be PIL Image. Got – PyTorch

I’m trying to prepare some image data for my neural to classify. As part of the image preprocessing step, I’m applying the HOG filter in my dataset class as such: After this, I define my train and validation transformation as such: and finally, I create the loaders as such: However, when I attempt…

How to convert string of list of list to list?

I have this file, it is the result of the MapReduce job so it has key-value format: I want to remove all the character except the second element of this value list: And finally, add each to a single list: This is my attempt so far: Output: You can see it is still str type, how can I make it