Skip to content
Advertisement

Tag: pytorch

Pytorch crashes cuda on wrong line

How to see which python line causes a cuda crash down the line in Pytorch, which executes asynchronous code outside of the GIL? Here is a case where I had Pytorch crash cuda, running this code on this dataset and every run would crash with the debugger on a different python line, making it very difficult to debug. Answer I

HTTPS POST to query FastAPI using python requests

I am trying to serve a Neural Network using FastAPI. The manual site http://localhost:8000/docs#/default/predict_predict_post works fine and translates into the following curl command: which also works. When I try to query the API using python requests: I only get the “422 Unprocessable Entity” Errors. Where am I going wrong here? Answer You provide a data argument to requests.post, which does

ValueError: Expected x_max for bbox (0.65, 0.51, 1.12, 0.64, 3) to be in the range [0.0, 1.0], got 1.1234809015877545

I want to apply data augmentations from PyTorch’s Albumentations to images with bounding boxes. When I apply the HorizontalFlip Transformation, I receive this error ValueError: Expected x_max for bbox (0.6505353259854019, 0.517013871576637, 1.1234809015877545, 0.6447916687466204, 3) to be in the range [0.0, 1.0], got 1.1234809015877545. I use the following code When I apply the Cutout transformation, I do not have any error

Scale down image represented in a tensor

I use the MNIST dataset to learn Pytorch. This is from the documentation to get a picture. Tensor comes from the torchvision dataset. This is the Tensor: I want to scale the image down to a 14×14 picture, so I guess I need a torch.Size([1, 14, 14]) I tried this, but it results in a different format: I expected this

Why is the code not able to approximate the square function?

WHy does the following code not work as a square approximator? I am getting weird dimensions. When I tried plotting loss, the graph somehow does not show anything. I am a beginner with pytorch, so I would be grateful for any help. Answer Your data is ranging from -10000 to 10000! You need to standardize your data, otherwise you won’t

Advertisement