RuntimeError: "sigmoid_cpu" not implemented for 'Long'. What is the issue here?

can somebody tell me why the error comes?!

or i will choose simple matrix!

ohh it is solved no need to answer! I forgot to use floating-points dtypes!

1 Like

Hey @mrittrukhuda, while initializing the tensor use 30., 2. (This creates a FloatTensor) instead of 30, 2 (This creates a LongTensor) which might not be supported by many methods.

1 Like

This is the error i am getting after i have uncommented the rotation, randomsize and colour jitter and running this cell


RuntimeError Traceback (most recent call last)
in ()
----> 1 show_batch(train_dl)

4 frames
/usr/local/lib/python3.6/dist-packages/torch/ in reraise(self)
426 # have message field
427 raise self.exc_type(message=msg)
→ 428 raise self.exc_type(msg)

RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/”, line 198, in _worker_loop
data = fetcher.fetch(index)
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/”, line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/”, line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/usr/local/lib/python3.6/dist-packages/torchvision/datasets/”, line 153, in getitem
sample = self.transform(sample)
File “/usr/local/lib/python3.6/dist-packages/torchvision/transforms/”, line 67, in call
img = t(img)
File “/usr/local/lib/python3.6/dist-packages/torch/nn/modules/”, line 727, in _call_impl
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/torchvision/transforms/”, line 823, in forward
i, j, h, w = self.get_params(img, self.scale, self.ratio)
File “/usr/local/lib/python3.6/dist-packages/torchvision/transforms/”, line 787, in get_params
log_ratio = torch.log(torch.tensor(ratio))
RuntimeError: log_vml_cpu not implemented for ‘Long’

whenever I’m trying sin in a tensor , it’s showing this error …

I’m guessing you created the tensor incorrectly.

Try changing the dtype to float (whatevernameforyourtensor.float())

3 posts were split to a new topic: RuntimeError: log_vml_cpu not implemented for ‘Long’. What is this error?