akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
Does a custom dataset need to always inherit the Dataset class?

username: Smth_w
cooked: <p>It may be a trivial question but while reading this tutorial: <a href="https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html" class="inline-onebox" rel="noopener nofollow ugc">TorchVision Object Detection Finetuning Tutorial — PyTorch Tutorials 1.7.1 documentation</a></p>
<p>I found this custom Dataset</p>
<pre><code class="lang-auto">class PennFudanDataset(object):
    def __init__(self, root, transforms):
        #random code
</code></pre>
<p>Which does not inherit torch.utils.data.Dataset (even though pytorch itself recommends us to "inherit <code>Dataset</code> ")</p>
<p>My question is simple, can I just create a custom dataset with just ‘object’ and not ‘Dataset’? if so is there a drawback for using ‘object’ instead of ‘Dataset’?</p>
<p>And since we are already here, why do we need to inherit ‘torch.utils.data.Dataset’ to create a custom dataset?<br>
I’ve checked the source code and it only contains <strong>getitem</strong> and <strong>add</strong>, do we do it only  because of “good practices” or is there something about this class I’m missing here??</p>
<p>Thanks for any help!!</p>

username: ptrblck
cooked: <p>It’s not strictly necessary, as the base <a href="https://github.com/pytorch/pytorch/blob/a61a8d059efa0fb139a09e479b1a2c8dd1cf1a44/torch/utils/data/dataset.py#L16-L40"><code>Dataset</code></a> implements the <code>__add__</code> method for you and defines the <code>__getitem__</code>, but for the sake of code clarity I would still recommend to derive your custom class from <code>Dataset</code>.</p>
Reading signed int from openCV in libtorch C++

username: John_J_Watson
cooked: <p>I have a cv::Mat which is CV_32SC3 type, it stores both positive and negative values.</p>
<p>When convert it to tensor, the values are messed up:</p>
<pre><code class="lang-auto">cout &lt;&lt; in_img &lt;&lt; endl;

 auto tensor_image = torch::from_blob(in_img.data, {1, in_img.rows, in_img.cols, 3}, torch::kByte);
</code></pre>
<p>The in_img has negative values, while after print out tensor_image, the values were all totally different than in_img.</p>
<p>the negative values are gone (it somehow seems to normilise it 255 range). I tried converting to Long like so:</p>
<pre><code class="lang-auto">auto tensor_image = torch::from_blob(in_img.data, {1, in_img.rows, in_img.cols, 3}, torch::kLong);
</code></pre>
<p>but when I print the values like so, I get seg fault:</p>
<pre><code class="lang-auto">  std::cout &lt;&lt; "tensor_image: " &lt;&lt; tensor_image &lt;&lt; " values." &lt;&lt; std::endl;
</code></pre>
<p>so, I tried looking at just the first element like so:</p>
<pre><code class="lang-auto">std::cout &lt;&lt; "input_tensor[0][0][0][0]: " &lt;&lt; tensor_image[0][0][0][0] &lt;&lt; " values." &lt;&lt; std::endl;
</code></pre>
<p>and the value is not the same as I see in the python implementation :((</p>

username: ptrblck
cooked: <p>Is this a double post from <a href="https://discuss.pytorch.org/t/at-kbyte-keeping-negative-values-in-float-for-inputs-to-model/112424">here</a>?</p>
Is there a way to scatter a tuple in DataParallel

username: Boltzmachine
cooked: <p>I have a list as input. Some of the elements in the list are tensors of (batch_size, *), while some of the are tuples of size (batch_size, ).</p>
<p>the whole list is like this</p>
<pre><code class="lang-auto">(tensor, tensor, tuple, tuple)
</code></pre>
<p>For example, batch_size is 48, the tuple is like this</p>
<pre><code class="lang-auto">t = (a, b, c, d, ... , zz)
len(t) = 48
</code></pre>
<p>this cannot be put into cuda since the element is string.</p>
<p>In practice, the tensor can be split to 8 devices with the new batch_size 6 (48/8=6), but the tuple is copied to every device. So is there a clean way to scatter the tuple to each device?</p>
Understanding pytorch binary cross entropy loss output

username: Vishal_Jain1
cooked: <p>I am trying to understand pytorch by building a basic perceptron with a sigmoid activation and then trying to train it to classify 2 datapoints into either class 0 or 1.</p>
<p>Data:<br>
input features l label<br>
[3,2] l 1<br>
[1,1] l 0</p>
<p>Code:</p>
<pre><code class="lang-auto">import torch 
import torchvision
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
# set random seed
torch.manual_seed(0)
class Perceptron(nn.Module):
    def __init__(self):
        super(Perceptron,self).__init__()
        self.linear = nn.Linear(in_features=2,out_features=1)
    
    def forward(self,x):
        x = self.linear(x)
        x = torch.sigmoid(x)
        return x

class testData(Dataset):
    def __init__(self):
        super(testData,self).__init__()
        test_data = [([3,2],1),([1,1],0)]
        self.data = test_data
    
    def __getitem__(self,index):
        dp,label = self.data[index]
        dp = torch.FloatTensor(dp)
        label = torch.tensor(label)
        return dp,label
    
    def __len__(self):
        return len(self.data)

def main():
    model = Perceptron()
    dataset = testData()
    dataloader = DataLoader(dataset,batch_size=2)
    for idx,batch in enumerate(dataloader):
        dp,label = batch
        print('data',dp)
        print('label',label)
        preds = model(dp)
        print('preds',preds)
        loss = F.binary_cross_entropy(preds.float(),label.unsqueeze(1).float())
        print('loss',loss)
    # loss = F.cross_entropy(preds,label)
    # print(loss)

if __name__ == "__main__":
    main()
</code></pre>
<p>Output</p>
<pre><code class="lang-auto">data tensor([[3., 2.],
        [1., 1.]])
label tensor([1, 0])
preds tensor([[0.5401],
        [0.4482]], grad_fn=&lt;SigmoidBackward&gt;)
loss tensor(0.6053, grad_fn=&lt;BinaryCrossEntropyBackward&gt;)
</code></pre>
<p>If I understand the binary cross entropy formula correctly, the output should be:</p>
<ul>
<li>( 1 * log(0.5401) + (1-0) *log(1-0.4482))<br>
And from this <a href="https://discuss.pytorch.org/t/bceloss-log-base/36833">previous post</a>, I am using log base e, I get my final answer as 1.21, not the 0.6053 given above. What is being calculated here?</li>
</ul>

username: Dwight_Foster
cooked: <p>So basically what is happening is that the binary cross entropy has two different reduction methods which you can see in the <a href="https://pytorch.org/docs/stable/generated/torch.nn.BCELoss.html#torch.nn.BCELoss" rel="noopener nofollow ugc">docs</a>. The default one is mean and the other option is sum. In your calculations you are using the sum version while the pytorch loss function is using the mean. All you need to do to your equation is just divide it by the number of outputs which in your case is two and then you will get the correct loss.</p>
Expected isFloatingType(grad.scalar_type()) || (input_is_complex == grad_is_complex) to be true, but got false

username: fsoest
cooked: <p>I’m getting this error when using a custom loss function when calling torch.autograd.backward().<br>
If I’m not mistaken it seems to have a problem with this part:</p>
<pre><code class="lang-auto">  File "custom_loss.py", line 184, in learn
    loss = self.criterion.forward(output, x)
  File "custom_loss.py", line 103, in forward
    A_2 = real_matmul(rho_2, (H_T[:, 2] - H_T[:, 1]))
  File "custom_loss.py", line 50, in real_matmul
    return A_real @ B_real - A_imag @ B_imag + 1j * (A_imag @ B_real + A_real @ B_imag)
 (Triggered internally at  /pytorch/torch/csrc/autograd/python_anomaly_mode.cpp:104.)

</code></pre>
<p>The function calculates the matrix product of two complex matrices through real matrix multiplication, as bmm doesn’t support complex grads.<br>
The error is then thrown here:</p>
<pre><code class="lang-auto"> File "custom_loss.py", line 185, in learn
    loss.backward()
  File "/home/fsoest/env/lib/python3.7/site-packages/torch/tensor.py", line 221, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/fsoest/env/lib/python3.7/site-packages/torch/autograd/__init__.py", line 132, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: Expected isFloatingType(grad.scalar_type()) || (input_is_complex == grad_is_complex) to be true, but got false.
</code></pre>

username: xsxjtu
cooked: <p>I got the same problem when using torch.fft.fft().<br>
As an alternative, I used the old representation, torch.fft(). This function can avoid this bug.</p>

username: WFS
cooked: <aside class="quote no-group" data-username="fsoest" data-post="1" data-topic="108984">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/fsoest/48/31196_2.png" class="avatar"> fsoest:</div>
<blockquote>
<p><code>return A_real @ B_real - A_imag @ B_imag + 1j * (A_imag @ B_real + A_real @ B_imag)</code></p>
</blockquote>
</aside>
<p>I had the same issue with custom functions using float tensors to return complex ones, I solved it by explicitly casting to complex the real and imaginary parts. You can try:</p>
<pre><code class="lang-auto">return (A_real @ B_real - A_imag @ B_imag).type(torch.complex64)  \
          + 1j * (A_imag @ B_real + A_real @ B_imag).type(torch.complex64)
</code></pre>

username: Mammothbagpipe
cooked: <p>Super! Thanks a lot for sharing this.</p>
How do i get the size about embedding lookup?

username: 111418
cooked: <p>Hi.<br>
I am studying memory bandwidth.<br>
I want to know the data capacity when I look up on the embedding table.<br>
For example, when you look up three out of five, how do you know how many bytes the three sizes are?<br>
Also, I want to know how much memory bandwidth is consumed when looking up using the EmbeddingBag function or the Embedding function.<br>
How can I check it?</p>
<p>Thank you.</p>
Why applying "sum" twice when calculating the regularisation term manually?

username: oat
cooked: <p><strong>[Context]</strong><br>
Book: <a href="https://www.manning.com/books/deep-learning-with-pytorch" rel="noopener nofollow ugc">Deep Learning with PyTorch</a> by Eli Stevens, Luca Antiga, and Thomas Viehmann<br>
Notebook: <a href="https://github.com/deep-learning-with-pytorch/dlwpt-code/blob/master/p1ch8/1_convolution.ipynb" rel="noopener nofollow ugc">Chapter 8 Convolutional Neural Network</a></p>
<p><strong>[Question]</strong><br>
Why <em>sum</em> is used <strong>twice</strong> when calculating the regularisation terms manually as shown in the code below?</p>
<pre><code class="lang-auto">def training_loop_l2reg(n_epochs, optimizer, model, loss_fn,
                        train_loader):
    for epoch in range(1, n_epochs + 1):
        loss_train = 0.0
        for imgs, labels in train_loader:
            imgs = imgs.to(device=device)
            labels = labels.to(device=device)
            outputs = model(imgs)
            loss = loss_fn(outputs, labels)

            l2_lambda = 0.001
            l2_norm = sum(p.pow(2.0).sum()
                          for p in model.parameters())  # &lt;1&gt;
            loss = loss + l2_lambda * l2_norm

            optimizer.zero_grad()
            loss.backward()
            optimizer.step()
            
            loss_train += loss.item()
        if epoch == 1 or epoch % 10 == 0:
            print('{} Epoch {}, Training loss {}'.format(
                datetime.datetime.now(), epoch,
                loss_train / len(train_loader)))
</code></pre>

username: KFrank
cooked: <p>Hi Oat!</p>
<aside class="quote no-group" data-username="oat" data-post="1" data-topic="112408" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/oat/48/34409_2.png" class="avatar"> oat:</div>
<blockquote>
<pre><code class="lang-auto">            l2_norm = sum(p.pow(2.0).sum()
                          for p in model.parameters())  # &lt;1&gt;
</code></pre>
</blockquote>
</aside>
<p>The first (scanning left to right, rather than in order of operation) <code>sum</code><br>
is a python sum where you sum over the elements generated by the<br>
“generator” (the expression inside of <code>sum</code>’s parentheses that looks like<br>
a python “list comprehension” without the list).  These elements happen<br>
to be pytorch tensors that contain single values.</p>
<p>The second sum, <code>p.pow(2.0).sum()</code>, is a pytorch sum that sums over<br>
the elements of a pytorch tensor (and returns a tensor that contains a<br>
single value).</p>
<p>Just for fun, you can turn the nested sum inside out, first performing a<br>
python sum over the generator (that generates python tensors containing<br>
multiple values), and then performing the pytorch sum that sums over<br>
elements of the resulting tensor (to get a single value):</p>
<pre data-code-wrap="python"><code class="lang-python">l2_norm = sum (p.pow(2.0)  for p in model.parameters()).sum()
</code></pre>
<p>Best.</p>
<p>K. Frank</p>
Exception with Jetson Xavier NX C++ and CUDA

username: chenry
cooked: <p>Hi,<br>
I built a model with python, I can also load it:</p>
<ul>
<li>with python on Jetson</li>
<li>with python or C++ on my x86_64 PC.<br>
With Jetson NX and C++, I get an exception:</li>
</ul>
<p>Could not run ‘aten::empty_strided’ with arguments from the ‘CUDA’ backend. ‘aten::empty_strided’ is only available for these backends: [CPU, BackendSelect, Named, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, Autocast, Batched, VmapMode].</p>
<p>CPU: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/build/aten/src/ATen/CPUType.cpp:2127 [kernel]<br>
BackendSelect: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/build/aten/src/ATen/BackendSelectRegister.cpp:761 [kernel]<br>
Named: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/aten/src/ATen/core/NamedRegistrations.cpp:7 [backend fallback]<br>
AutogradOther: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
AutogradCPU: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
AutogradCUDA: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
AutogradXLA: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
AutogradPrivateUse1: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
AutogradPrivateUse2: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
AutogradPrivateUse3: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/VariableType_0.cpp:7974 [autograd kernel]<br>
Tracer: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/torch/csrc/autograd/generated/TraceType_0.cpp:9341 [kernel]<br>
Autocast: fallthrough registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/aten/src/ATen/autocast_mode.cpp:254 [backend fallback]<br>
Batched: registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/aten/src/ATen/BatchingRegistrations.cpp:511 [backend fallback]<br>
VmapMode: fallthrough registered at /media/nvidia/WD_NVME/PyTorch/JetPack_4.4.1/pytorch-v1.7.0/aten/src/ATen/VmapModeRegistrations.cpp:33 [backend fallback]</p>
<p>Actually, it throws already with this line:<br>
torch::Tensor tensor = at::tensor({ -1, 1 }, at::kCUDA);</p>
<p>at::cuda::is_available() is returning true.</p>
<p>Loading the model with kCPU also works.</p>
<p>I tried with torch 1.6 and 1.7, with the same result.<br>
I link with:<br>
libtorch.so<br>
libtorch_cpu.so<br>
libtorch_cuda.so<br>
libc10.so<br>
libc10_cuda.so</p>
<p>Any idea?</p>
Plot a 3D skeleton pose data in 3D space

username: rubijade
cooked: <p>hello. Maybe it is the right place for this topic but I am working on this for a while but cannot succeed to implement it and need your help.<br>
My goal is to reproduce this image bellow from the 3D pose data obtained from skeleton estimation of human pose using LCR-NET++<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/e/d/edf0f9f15adfbb6a21b6e0d9281c8c6ec1117cb8.png" alt="skeleton" data-base62-sha1="xWVrTuWiJs5Hp2A0GqzfziP1JR6" width="76" height="136"></p>
<p>the pose estimation for one image frame is here:<br>
“pose3d”: [-0.013501551933586597, -0.14018067717552185, 0.03889404982328415, -0.01468866690993309, -0.052195221185684204, -0.019107796251773834, 0.1497691571712494, 0.3384685516357422, -0.01354127749800682, 0.20444869995117188, -0.01537160761654377, 0.10283246636390686, 0.16161373257637024, -0.9542085528373718, -1.0142440795898438, -0.5674616694450378, -0.6482287049293518, -0.21104587614536285, -0.26092272996902466, 0.01090222503989935, -0.06246425583958626, 0.07578188925981522, -0.06475285440683365, 0.27830997109413147, 0.16628871858119965, 0.40817680954933167, 0.4491078853607178, 0.26747873425483704, 0.3288397789001465, 0.15092524886131287, 0.14701153337955475, -0.013860990293323994, 0.31942757964134216, -0.10401999950408936, 0.2921887934207916, -0.2079567015171051, 0.12265170365571976, -0.21420519053936005, -0.07994606345891953]</p>
<p>Here is my code. What is missing?</p>
<pre><code class="lang-auto">from mpl_toolkits import mplot3d

import numpy as np
import matplotlib.pyplot as plt

ax = plt.axes(projection='3d')

fig = plt.figure()
xdata = np.array([-0.013501551933586597, -0.14018067717552185, 0.03889404982328415, -0.01468866690993309, -0.052195221185684204, -0.019107796251773834, 0.1497691571712494, 0.3384685516357422, -0.01354127749800682, 0.20444869995117188, -0.01537160761654377, 0.10283246636390686, 0.16161373257637024])
ydata = np.array([-0.9542085528373718, -1.0142440795898438, -0.5674616694450378, -0.6482287049293518, -0.21104587614536285, -0.26092272996902466, 0.01090222503989935, -0.06246425583958626, 0.07578188925981522, -0.06475285440683365, 0.27830997109413147, 0.16628871858119965, 0.40817680954933167])
zdata = np.array([0.4491078853607178, 0.26747873425483704, 0.3288397789001465, 0.15092524886131287, 0.14701153337955475, -0.013860990293323994, 0.31942757964134216, -0.10401999950408936, 0.2921887934207916, -0.2079567015171051, 0.12265170365571976, -0.21420519053936005, -0.07994606345891953])
ax.scatter3D(xdata, ydata, zdata, c=zdata)

plt.show()
</code></pre>

username: ptrblck
cooked: <p>I think your code is missing the logic to connect the points, as <code>scatter3D</code> would only visualize the points, if I’m not mistaken.<br>
Since this question isn’t really PyTorch-related, I would guess you might get a faster answer in other discussion boards / mailing lists.<br>
I would also check repositories working on pose detection models, as they might already have code to visualize it.</p>
requires_grad=False after inputs.ge(0.5)

username: zs963048949
cooked: <p>The variable ‘inputs’ is a output of net.The variable will be inputed to loss function.However,the attribute of requires_grad was changed into ‘False’ after I executed the following:<code>inputs = inputs.ge(0.5).float()</code><br>
If this case,can it execute backpropagation in the network normally?If not,why? How can I solved it? Thanks in advance.</p>

username: ptrblck
cooked: <aside class="quote no-group" data-username="zs963048949" data-post="1" data-topic="112406">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/zs963048949/48/33734_2.png" class="avatar"> zs963048949:</div>
<blockquote>
<p>If this case,can it execute backpropagation in the network normally?If not,why?</p>
</blockquote>
</aside>
<p>No, you won’t be able to calculate the gradients after the <code>tensor.ge</code> operation, since it’s not differentiable and would thus break the computation graph.<br>
You could use a “soft” function such as e.g. <code>sigmoid</code> instead.</p>
Reorder non-zero values in a 2d matrix

username: cruvadom
cooked: <p>I’m looking for an elegant pytorch way to take a 2d matrix and move all non-zero values to the beginning of each row, while keeping their order. My current solution is super hacky, there must be something nicer?</p>
<p>For example:<br>
input:<br>
[[1, 5, 0, 2, 0, 0],<br>
[0, 0, 9, 7, 0, 0]</p>
<p>output:<br>
[[1, 5, 2, 0, 0, 0],<br>
[9, 7, 0, 0, 0, 0]</p>

username: Eta_C
cooked: <p>My solution</p>
<pre><code class="lang-python">index = torch.sort((x != 0) * 1, dim=1, descending=True)[1]
y = x.gather(1, index)
</code></pre>

username: cruvadom
cooked: <p>Nice one! Thanks for that.</p>

username: cruvadom
cooked: <p>Actually there’s an issue: I find the sort order of identical items to be non-deterministic (probably on GPU only). For example on the row (part of a 2-D matrix)</p>
<p>[1023,    8, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,<br>
606, 1023, 1023, 1023, 1023, 1023,  408, 1023, 1023, 1023,  427, 1023]</p>
<p>I got the result</p>
<p>[ 408,  427,    8,  606, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,<br>
1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023]</p>
<p>(1023 acts as 0 here).</p>

username: Eta_C
cooked: <aside class="quote no-group" data-username="cruvadom" data-post="4" data-topic="112314">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/cruvadom/48/30786_2.png" class="avatar"> cruvadom:</div>
<blockquote>
<p>I find the sort order of identical items to be non-deterministic (probably on GPU only).</p>
</blockquote>
</aside>
<p>Maybe…</p>
<pre data-code-wrap="python"><code class="lang-python"># 1. get nonzero mask
s_mask = x != 0

# 2. get head mask
d_mask = torch.sum(s_mask, dim=1, keepdims=True) &gt; torch.arange(x.shape[1])

# copy
y = torch.zeros_like(x) 
y[d_mask] = x[s_mask]
</code></pre>
Nn.functional.dropout behaviour in eval() mode

username: Darek554
cooked: <p>Hi.<br>
I’m wondering - if i use F.dropout in forward() method in my model, instead of nn.Dropout module defined in <strong>init</strong> - is pytorch using dropout while evaluating or not?</p>

username: MrPositron
cooked: <p>Both are completely equivalent in terms of applying dropout and even though the differences in usage are not that big, there are some reasons to favour the <code>nn.Dropout</code> over <code>nn.functional.dropout</code>:</p>
<p>Dropout is designed to be only applied during training, so when doing predictions or evaluation of the model you want dropout to be turned off.</p>
<p>The <strong>dropout module</strong> <code>nn.Dropout</code> <strong>conveniently handles this and shuts dropout off as soon as your model enters evaluation mode</strong>, while the <strong>functional dropout does not care about the evaluation / prediction mode</strong>.</p>
<p>Even though you <strong>can</strong> set functional dropout to <code>training=False</code> to turn it off, it is still not such a convenient solution like with <code>nn.Dropout</code>.</p>
<p>Also the drop rate is stored in the module, so you don’t have to save it in an extra variable. In larger networks you might want to create different dropout layers with different drop rates - here <code>nn.Dropout</code> may increase readability and can bear also some convenience when using the layers multiple times.</p>
<p>Finally, all modules which are assigned to your model are registered in your model. So you model class keeps track of them, that is why you can just turn off the dropout module by calling <code>eval()</code>. When using the functional dropout your model is not aware of it, thus it won’t appear in any summary.</p>
<p>Source: <a href="https://stackoverflow.com/questions/53419474/using-dropout-in-pytorch-nn-dropout-vs-f-dropout" class="inline-onebox" rel="noopener nofollow ugc">neural network - Using Dropout in Pytorch: nn.Dropout vs. F.dropout - Stack Overflow</a></p>

username: ptrblck
cooked: <p>Small addition to:</p>
<aside class="quote no-group" data-username="MrPositron" data-post="2" data-topic="112363">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mrpositron/48/8671_2.png" class="avatar"> MrPositron:</div>
<blockquote>
<p>So you model class keeps track of them, that is why you can just turn off the dropout module by calling <code>eval()</code>. When using the functional dropout your model is not aware of it, thus it won’t appear in any summary.</p>
</blockquote>
</aside>
<p>The right approach would be to use the internal <code>self.training</code> flag, which is manipulated by calling <code>model.train()</code> and <code>model.eval()</code> via:</p>
<pre data-code-wrap="python"><code class="lang-python">x = F.dropout(x, p=self.p, training=self.training)
</code></pre>
<p>This would also enable and disable this dropout call if <code>model.train()</code> or <code>model.eval()</code> is called, respectively.</p>
New formulation for updating parameters

username: FA_mn
cooked: <p>Hello,</p>
<p>If I want to uses <code>Params = Params + inverse(J'*J + mu * I) * g</code> instead of <code>Params = Params + mu * g</code>,<br>
where <code>J</code> is a Jacobian matrix and <code>J'</code> is transpose of <code>J</code>, and <code>J(i,j) = d loss(i) / d params(j)</code>,<br>
and <code>g</code> is a gradient vector, <code>g = J' * loss</code><br>
and <code>I</code> is identity matrix,<br>
and <code>mu</code> is a scaler.</p>
<p>How can I compute jacobian matrix and <code>inverse(J'*J + mu * I) </code>, and finally update parameters with the above formulation?</p>
<p>Thanks.</p>
Gabor filter with cifar10 data

username: Zidane
cooked: <p>Hi,<br>
I am implementing gabor filter for cifar10 data but getting this error</p>
<p>error: OpenCV(4.5.1) /tmp/pip-req-build-7m_g9lbm/opencv/modules/imgproc/src/color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function ‘cv::impl::{anonymous}::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::impl::{anonymous}::Set&lt;3, 4&gt;; VDcn = cv::impl::{anonymous}::Set&lt;1&gt;; VDepth = cv::impl::{anonymous}::Set&lt;0, 2, 5&gt;; cv::impl::{anonymous}::SizePolicy sizePolicy = cv::impl::::NONE; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]’</p>
<blockquote>
<p>Invalid number of channels in input image:<br>
‘VScn::contains(scn)’<br>
where<br>
‘scn’ is 1</p>
</blockquote>
<p>This is the part of the code showing the error, the error specifically in this line<br>
‘x = cv2.cvtColor(np.float32(x), cv2.COLOR_BGR2GRAY)’<br>
<span class="hashtag-raw">#Gabor</span> bank<br>
num = 0<br>
for batch_idx, (x, t) in enumerate(cifar_trainset):<br>
current_batch_size = x.data.size()[0]<br>
x, t = x.to(device), t.to(device)</p>
<pre><code>x = cv2.cvtColor(np.float32(x), cv2.COLOR_BGR2GRAY)
#generating the gabor filtered images and saving them
num = 0
for i in range (5):
    kernel = cv2.getGaborKernel((10, 10), result_sigma[i],
    result_theta[i], result_lambdaa[i],result_gamma[i], result_psi[i], ktype=cv2.CV_32F)
    gabor_label = str(num)  


    fimg = cv2.filter2D(np.float32(x), cv2.CV_8UC3, kernel)
    img_resized = cv2.resize (fimg, (32,32))
    img_tensor = torch.from_numpy(img_resized).long()

    torch.save (img_tensor,'/home/mzidane/gabor_filtered_cifar10/gfiltered_images/gabor_filtered_images'+ str(gabor_label)+'.pt')

            
    print(gabor_label, ': theta=', result_theta[i], ': sigma=',result_sigma[i],
    ': lamda=', result_lambdaa[i], ': gamma=', result_gamma[i], ': psi=', result_psi[i])
            
    num += 1
</code></pre>
<p>Could you help in that?</p>

username: ptrblck
cooked: <p>Based on the error message it seems OpenCV is failing to convert a grayscale image to “gray” in:</p>
<pre><code class="lang-python">x = cv2.cvtColor(np.float32(x), cv2.COLOR_BGR2GRAY)
</code></pre>
<p>since the input image already contains a single input channel.<br>
You might need to load all images using 3 channels and convert them to gray afterwards in case you are working with a mixed dataset (or just skip the already gray images).</p>
ABI compatibility of self building Pytorch

username: Yinghui_Liu
cooked: <p>In my organization, we maintain a pytorch package building from source, because we have some specific features. But some third-party libs, even first party libs, like torchvision, will throw runtime exception: … …<br>
undefined symbol … …<br>
I think it’s a ABI compatibility problem.<br>
So, is there a solution about this problem to keep our self building pytorch is ABI compatibility with community ones?<br>
Thanks for you guys, I really want to know the answer.</p>
Text classification

username: neda_vida
cooked: <p>Hi dear friends. I have a dataset for text classification. This dataset is divided into two folders of train and test. Them, each of them is divided into two folders of negative and positive. And, in every positive and negative folders I have 1000 text file in which you can see a sentence.<br>
And, also next to these, I have a notepad file, in which there are 56050 words with their vectors. I think it’s called dictionary.<br>
Now, I should just classify them. I didn’t worked on this topic at all. I uploaded my dataset on google drive and uploaded it in google colab.</p>
<p>from google.colab import drive<br>
drive.mount(’/content/drive’)<br>
train_data=’/content/drive/MyDrive/data/train’<br>
test_data=’/content/drive/MyDrive/data/test/’</p>
<p>print(f’Number of training examples: {len(train_data)}’)<br>
print(f’Number of testing examples: {len(test_data)}’)</p>
<p>now, when i run this code, it gives me 33 for length. Why does it happen? What is wrong in my proedure. Please help me.<br>
thank you</p>

username: CedricLy
cooked: <p>Hi neda,</p>
<p>with len(train_data) you do not get the number of files in this directory but the umber of characters in your string.<br>
train_data is still only the pathname.</p>

username: neda_vida
cooked: <p>really thank you. Then, how can I reach number of sentences in my train_data?<br>
according to what you said, I think I need a code to read a train data folder with its sub folders, but I don’t know how to do it. I appreciate it friends help me.<br>
Thank you</p>

username: CedricLy
cooked: <pre><code class="lang-auto">import os

train_files = os.listdir(train_data) # returns list of file in pathargument || should give you folder ['positive','negative']
train_file_positive = os.listdir(train_data + train_data_files[0]) # return just one text file path
</code></pre>
<p>Depending the the file format for your text you need to open it.<br>
For normal .txt files it will be something like:</p>
<pre><code class="lang-auto">with open(train_file_positive, 'rb') as f:
    sentence = f.read()
</code></pre>

username: neda_vida
cooked: <p>Thank you so much. I will try it and give you the output.<br>
Many thanks</p>
GPU Efficient Variation of Scatter

username: Soham_Tamba1
cooked: <p>I am trying the accomplish the operation below in a manner that does not require for-loops (maximize performance on GPU).</p>
<pre><code class="lang-auto">def add_accumulate(src, index, dest):
  B, C, H, W = src.shape
  B, H, W = ind.shape
  M, C = dest.shape 
  # All overlapping sizes above are the same

  for b in range(B): 
     for h in range(H):
       for w in range(W):
          dest[index[b,h,w], :] += src[b, :, h, w] 
  return dst
</code></pre>
<p>I’ve noticed that <a href="https://pytorch.org/docs/master/tensors.html#torch.Tensor.scatter_add_" rel="noopener nofollow ugc">torch.Tensor.scatter_add_</a> does something similar, but not the same. Any idea how I can modify the function to perform this operation efficiently? I’m guessing I would have to modify the inputs. I don’t think scatter allows broadcasting.</p>
<p>Scatter can be used to accomplish:<br>
<code>dest[ index[b][c][h][w] ][c][h][w] += src[b][c][h][w]</code></p>

username: Eta_C
cooked: <p>If <code>index</code> is <strong>UNIQUE</strong>, try</p>
<pre><code class="lang-python">def add_accumulate(src, index, dest):
    C = dest.shape[-1]
    dest[index.flatten(), :] += src.permute(0, 2, 3, 1).reshape(-1, C)
    return dest
</code></pre>

username: Soham_Tamba1
cooked: <p>Edit 1: index is not unique</p>

username: Soham_Tamba1
cooked: <p>Thanks, but <code>index</code> may have duplicate entries</p>
Loss object has no attribute 'backward'

username: BartolomeD
cooked: <p>Just recently I have upgraded my Torch build from 0.1.11 to 0.1.12. Since I have done so, however, I can’t perform a backward pass on a loss object. I get the error: AttributeError: ‘BCELoss’ object has no attribute ‘backward’.</p>
<p>Below is the code I use.</p>
<pre><code>    critBCE = nn.BCEloss()

    for i, (img, lab) in enumerate(source_loader):

        # train the discriminator on source examples
        Yd = Variable(lab)
        X2 = Variable(img)
        output = dis.forward(X2)
        err_real += critBCE.forward(output.float(), Yd.float())
        t = critBCE.backward(output.float(), Yd.float())
        dis.backward(X2, t)
</code></pre>
<p>This is the error that is raised:</p>
<pre><code>---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
&lt;ipython-input-15-e0dbb18c7e0e&gt; in &lt;module&gt;()
     48         output = dis.forward(X2)
     49         err_real += critBCE.forward(output.float(), Yd.float())
---&gt; 50         t = critBCE.backward(output.float(), Yd.float())
     51         dis.backward(X2, t)
     52 

/home/daniel/miniconda3/envs/py3/lib/python3.5/site- packages/torch/nn/modules/module.py in __getattr__(self, name) 

AttributeError: 'BCELoss' object has no attribute 'backward'
</code></pre>
<p>Anyone has an idea? Does it have to do with the upgrade?</p>

username: smth
cooked: <p>the criterion itself never had backward. If this code worked for you previously, that’s strange.</p>
<p>Also, critBCE.forward is wrong and your overall code is fairly wrong.</p>
<p>Your code should be something of this order:</p>
<pre><code class="lang-auto">        output = dis(X2)
        loss = critBCE(output.float(), Yd.float())
        err_real += loss.data[0]
        loss.backward()
</code></pre>
The accuracy declined after using pytorch apex

username: zs963048949
cooked: <p>I found the accuracy declined by about 3%~5%.What’s more,the loss value often occurs NaN after using pytorch apex.Do you know what cause them? Thanks in advance.<br>
Python Version:3.65<br>
Pytorch Version:1.6</p>

username: ptrblck
cooked: <p>We recommend to use the native mixed-precision training utility via <code>torch.cuda.amp</code>, as the future development will be focused on it. The docs can be found <a href="https://pytorch.org/docs/stable/amp.html">here</a>.</p>

username: zs963048949
cooked: <p>I refer to the <a href="https://pytorch.org/docs/stable/notes/amp_examples.html" rel="noopener nofollow ugc">docs</a>.Is there any difference?</p>

username: ptrblck
cooked: <p>Better compatibility with PyTorch, future improvements etc. as described <a href="https://github.com/NVIDIA/apex/issues/818">here</a> and <a href="https://discuss.pytorch.org/t/torch-cuda-amp-vs-nvidia-apex/74994/3">here</a>.</p>

username: zs963048949
cooked: <p>I using torch.cuda.amp in pytorch.I just added the automatic mixed precision training code described in <a href="https://pytorch.org/docs/master/notes/amp_examples.html#amp-examples" rel="noopener nofollow ugc">here</a> in a normal code without any data parallel.However,I got a very different result,and even loss is NaN.I think the accuracy should change a little,rather than a large change.</p>

username: ptrblck
cooked: <p>If the loss is getting a NaN value, I assume your model output is also already containing invalid values.<br>
Could you post the model you are using as well as the stats of your input data (min., max., mean) so that we could try to reproduce this issue?</p>

username: zs963048949
cooked: <p>OK ，if I have some free time,thanks.</p>
Gather each row except specific column in a torch Tensor

username: Fei-Wang
cooked: <p>Similar to <a href="https://discuss.pytorch.org/t/select-specific-columns-of-each-row-in-a-torch-tensor/497" class="inline-onebox">Select specific columns of each row in a torch Tensor</a>, But I want to gather except specific column.</p>
<p>For example, Given</p>
<pre><code class="lang-auto">input = torch.tensor([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]])
</code></pre>
<p>and</p>
<pre><code class="lang-auto">target = torch.tensor([0, 3, 2])
</code></pre>
<p>I want to get</p>
<pre><code class="lang-auto">output = torch.tensor([[2, 3, 4], [5, 6, 7], [9, 10, 12]])
</code></pre>
<p>Thanks.</p>

username: Eta_C
cooked: <p>Bro,</p>
<pre><code class="lang-python">input = input[(1 - torch.nn.functional.one_hot(target, input.shape[1])).bool()].reshape(input.shape[0], -1)
</code></pre>

username: Fei-Wang
cooked: <p>Thanks, that’s exactly what I needed</p>
How to connect NLP chatbot model to android Application

username: it17178396_Tharanga
cooked: <p>I’m building an android application (chatbot) for answering mathematics algebra questions. In that, I am made a chatbot model using PyTorch and neural net. But I do not clearly understand how to connect that model in my android studio application. I’m Searching how to connect that model to my android application.</p>

username: vdw
cooked: <p>I’m not quite sure what your setup is, but I assume that you network model runs in some kind of server.</p>
<p>The easiest ways is to expose your model via adding an API layer. In Python, this is relatively easy to with <a href="https://medium.com/idealo-tech-blog/falcon-vs-flask-which-one-to-pick-to-create-a-scalable-deep-learning-rest-api-adef647ebdec" rel="noopener nofollow ugc">Flask or Falcon</a>. The goal is that you then have API endpoints to which your mobile app can send requests and get results. For example, an endpoint might look like</p>
<pre><code>https://myserver.com/chatbot/v1/response/
</code></pre>
<p>Which accepts <code>POST</code> requests with a text as parameter. The response will be the chatbots reply which is sent back to your mobile app.</p>
<p>Best have a look into REST APIs, and Falcon and/or Flask to get the basic idea. I’ve done exactly this setup for an app of mine, and it’s pretty straightforward.</p>
Numpy memmap throttles with Dataloader when available RAM less than file size

username: Kevin_Shen
cooked: <p>I’m working on a dataset that is too big to fit into RAM. The solution I’m trying currently is to use numpy memmap to load one sample/row at a time using Dataloader. The solution looks something like this:</p>
<pre><code class="lang-auto">class MMDataset(torch.utils.data.Dataset):
    def __init__(self, path):
        self.file_path = path
        self.dataset_len = 44000000
        self.bytes_per_value = 32/8
        self.num_cols = 512
        self.num_rows = 1


    def __getitem__(self, index):
        

        x = np.memmap(self.file_path, dtype='float32', mode='r', shape=(
            self.num_rows, self.num_cols), offset=int(index*self.num_cols*self.bytes_per_value))

        return np.array(x)

    def __len__(self):
        return self.dataset_len



dataset = MMDataset('./data/emb.memmap')

data_loader = DataLoader(
    dataset,
    batch_size=4096,
    shuffle=True,
    num_workers=20
)

</code></pre>
<p>When the amount of RAM available is greater than the size of the memmap file, the data loading is fast. I get around 60 batches/second. However, when the RAM available is less than the size of the memmap file, I get around 3 batches/second.</p>
<p>I discovered this when trying various sizes for the memmap file.</p>
<p>Why is this the case? If Dataloader + memmap is going to throttle when available RAM &lt; memmap file size, this defeats the point of the solutoin.</p>
<p>I’ve observed that disk i/o is at 500MB/s read constantly when available RAM &lt; memmap file size. This is much higher than the theoretical amount of reading required to load a batch of 4096 samples (closer to 8MB/s).</p>

username: JuanFMontesinos
cooked: <p>Can you check everything with shuffling off?<br>
Think that you have 44M samples. It means there will exist a vector of length 44M which you will have to shuffle.</p>

username: Kevin_Shen
cooked: <p>This seems to solve it! Do you mind explaining a little why shufle=True made it slower?</p>
<p>Don’t I still need to shuffle the dataset to train my model? How would I work around this?</p>

username: Kevin_Shen
cooked: <p>Actually I think the problem still isn’t solved. I think the reading is quick because reading in order allows us to cache blocks of contiguous rows. If I manually reindex to random indices, it’s slow again.</p>

username: JuanFMontesinos
cooked: <p>Hi, sorry for the late replay.<br>
You are not using mmap “properly”.<br>
mmap should be defined in the init functionn (not in getittem).<br>
Once you define it you can treat it as a normal array.<br>
When you try to retrieve the data it will read it from disk.<br>
Defining the mmap instance in getitem makes no sense to me.</p>
<p>The problem with shuffling is it takes lot of memory to generate indices. Besides, you will encounter this problem of reading contiguous blocks of memory. It’s indeed way faster than reading separate blocks.</p>
Torchtext BOW SGD gradient explosion

username: vas
cooked: <p>I am trying to reimplement the torch text <a href="https://pytorch.org/tutorials/beginner/text_sentiment_ngrams_tutorial.html" rel="noopener nofollow ugc">example</a></p>
<p>The example is simple and clear, however, it doesn’t use the standard torchtext <strong>Iterators</strong> instead it has it’s own dataloader and batch generator (and it seems for reason).</p>
<p>I tried to reimplement the code with the standard <strong>Interator</strong>. But this lead to gradient explosion. Then I tried to use <strong>BucketIterator</strong> that groups similar length string together, and at least, it didn’t explode but didn’t learn too.</p>
<p>Obviously, padding is useless for this architecture, but I didn’t find a way to disable padding in torchtext. On the other hard, why padding works so bad with SGD? When I replace SGD with Adam everything went smoothly.</p>
<p>A lot of questions and no answers.</p>
Averaging the tensor values based on indices

username: Neeraj_Varshney
cooked: <p>Given a tensor with shape (batch_size, seq_length, vocab_size)<br>
It represents output from a transformer model and at each seq position gives a probability for each vocab token for all elements in the batch.</p>
<pre><code class="lang-auto">torch.max(logits, dim=2)
</code></pre>
<p>returns the values and corresponding indices<br>
For example (batch size is 1),</p>
<pre><code class="lang-auto">torch.return_types.max(values=tensor([[ -7.8091,  -4.1528, -14.3334,  -3.2233,  -1.9405,  -3.9196,  -1.6090,
          -6.7052,  -7.1221,  -7.4800]], grad_fn=&lt;MaxBackward0&gt;), indices=tensor([[32099,    31,     7,    34,     5,     1,     1,     3,     3,     3]]))
</code></pre>
<p>I want to compute the average of maximum values before the occurrence of index 1<br>
i.e before index 5</p>
<pre><code class="lang-auto">average([ -7.8091,  -4.1528, -14.3334,  -3.2233,  -1.9405])
</code></pre>
<p>for all elements in the batch.<br>
What is the optimal way to achieve this</p>
General question

username: jpj
cooked: <p>My output layer has 2 neurons, and doing binary classification.<br>
The sigmoid output from the hidden player outputs a n rows and 2 columns shape.<br>
The target labels are in format [0,1,0…1] format.<br>
When calculating the loss function, should I be converting probabilities from the sigmoid output less than 0.5 to class 1 and more than 0.5 to class 0.<br>
Or calculate the loss directly using the probability and the target label?<br>
Thanks</p>

username: aguennecjacq
cooked: <p>You should keep the probabilities as they are when inputting them in the loss function with their target. Moreover, if you are doing binary classification, you only need one neuron as your end layer (either it’s 1 or 0).  Another quick tip: don’t use the sigmoid function as the output of your nn model. Leave the output as it is and use <code>torch.nn.BCEWithLogitsLoss</code> as the loss function. It directly intergrates the sigmoid function and has better numerical stability.</p>
Multigpu, Segmentation fault

username: cedricchan
cooked: <p>I encountered this problem when training with multi gpu after a few epochs. Sometimes the error is “Segmentation fault (core dumped)”.</p>
<p>My pyTorch version is 1.4.0, cuda version is 10.1.</p>
<pre><code class="lang-auto">terminate called after throwing an instance of 'c10::Error'
  what():  invalid device pointer: 0x7f3872000000 (free at /pytorch/c10/cuda/CUDACachingAllocator.cpp:349)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&amp;) + 0x33 (0x7f3e05796193 in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/l
ib/libc10.so)
frame #1: &lt;unknown function&gt; + 0x19e68 (0x7f3e07c20e68 in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/libc10_cuda.so)
frame #2: c10::TensorImpl::release_resources() + 0x4d (0x7f3e0578663d in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #3: &lt;unknown function&gt; + 0x18b2909 (0x7f3d5e933909 in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #4: &lt;unknown function&gt; + 0x38b9a3d (0x7f3d6093aa3d in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #5: torch::autograd::Engine::evaluate_function(std::shared_ptr&lt;torch::autograd::GraphTask&gt;&amp;, torch::autograd::Node*, torch::autograd::InputBuffer&amp;) + 0x
10fc (0x7f3d610921dc in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #6: torch::autograd::Engine::thread_main(std::shared_ptr&lt;torch::autograd::GraphTask&gt; const&amp;, bool) + 0x4b2 (0x7f3d61093082 in /home/WeicongChen/anaconda
3/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #7: torch::autograd::Engine::thread_init(int) + 0x39 (0x7f3d6108c979 in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #8: torch::autograd::python::PythonEngine::thread_init(int) + 0x2a (0x7f3e0cb8a91a in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/lib/
libtorch_python.so)
frame #9: &lt;unknown function&gt; + 0xedef (0x7f3e0d7b1def in /home/WeicongChen/anaconda3/lib/python3.7/site-packages/torch/_C.cpython-37m-x86_64-linux-gnu.so)
frame #10: &lt;unknown function&gt; + 0x76db (0x7f3e11ea76db in /lib/x86_64-linux-gnu/libpthread.so.0)
frame #11: clone + 0x3f (0x7f3e11bd088f in /lib/x86_64-linux-gnu/libc.so.6)
</code></pre>

username: ptrblck
cooked: <p>Could you install the latest nightly binary and rerun the code, please?</p>

username: cedricchan
cooked: <p>It works, thank you!</p>

username: Kush_Shrivastava
cooked: <p>This really worked…</p>