Cannot initialize CUDA without ATen_cuda library problem even if I am not using CUDA

username: Siddharth_Saurabh
cooked: <blockquote>
<p><a href="https://drive.google.com/open?id=12xP1Ll4UeI4tt7Cq0P9dtaSPCF_sqOoh" rel="noopener nofollow ugc">https://drive.google.com/open?id=12xP1Ll4UeI4tt7Cq0P9dtaSPCF_sqOoh</a></p>
</blockquote>
<p>This is the program I am trying to build and I am not using cuda anywhere because I have MacBook air which can not support cuda. Can anyone help me with what is the problem that it is showing a CUDA error??</p>
<p>the error is generated     input_img = Variable(image_tensor.type(Tensor)) i.e in line 20 of detect_image(img)</p>

username: ptrblck
cooked: <p>What kind of error message do you get?<br>
I cannot find a definition for <code>Tensor</code>. Did you use <code>from torch import *</code> somewhere?</p>

username: Siddharth_Saurabh
cooked: <blockquote>
<p><a href="https://github.com/cfotache/pytorch_objectdetecttrack" class="inline-onebox" rel="noopener nofollow ugc">GitHub - cfotache/pytorch_objectdetecttrack: Object detection in images, and tracking across video frames</a><br>
this is the repo I am using. All files are here in this repo but I am not able to build it in my local due to lack of cuda</p>
</blockquote>

username: Siddharth_Saurabh
cooked: <p>ERROR --&gt;</p>
<pre><code class="lang-auto">---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
&lt;ipython-input-21-2620be06dd37&gt; in &lt;module&gt;
      4 prev_time = time.time()
      5 img = Image.open(img_path)
----&gt; 6 detections = detect_image(img)
      7 inference_time = datetime.timedelta(seconds=time.time() - prev_time)
      8 #print ('Inference Time: %s' % (inference_time))

&lt;ipython-input-20-5e3b41feb37a&gt; in detect_image(img)
     17     image_tensor = image_tensor.unsqueeze_(0)
     18     print(image_tensor)
---&gt; 19     input_img = Variable(image_tensor.type(Tensor))
     20     print("3")
     21     # run inference on the model and get detections

RuntimeError: Cannot initialize CUDA without
 ATen_cuda library. PyTorch splits its backend
 into two shared libraries: a CPU library and a 
CUDA library; this error has occurred because
 you are trying to use some CUDA functionality,
 but the CUDA library has not been loaded by 
the dynamic linker for some reason.  The CUDA
 library MUST be loaded, EVEN IF you don't 
directly use any symbols from the CUDA library! 
One common culprit is a lack of -Wl,--no-as-
needed in your link arguments; many dynamic 
linkers will delete dynamic library dependencies 
if you don't depend on any of their symbols.  
You can check if this has occurred by using ldd 
on your binary to see if there is a dependency 
on *_cuda.so library.
</code></pre>

username: ptrblck
cooked: <p>This is not a CUDA error. Apparently the module is missing.<br>
Did you clone the whole repository and started your terminal / notebook in this directory?</p>

username: Siddharth_Saurabh
cooked: <p>sir I have changed the error… the last was a wrong one… Kindly review it once again</p>

username: Siddharth_Saurabh
cooked: <p>basically the error is somewhere in</p>
<pre><code class="lang-auto"># convert image to Tensor
    image_tensor = img_transforms(img).float()
    image_tensor = image_tensor.unsqueeze_(0)
    input_img = Variable(image_tensor.type(Tensor))
    # run inference on the model and get detections
    with torch.no_grad():
        detections = model(input_img)
        detections = utils.non_max_suppression(detections, 80, conf_thres, nms_thres)
    return detections[0]
</code></pre>
<p>this section is in PyTorch_Object_Detection.ipynb in the detect_image(img) function</p>

username: ayni-af
cooked: <p>Hi <a class="mention" href="/u/siddharth_saurabh">@Siddharth_Saurabh</a> , did you find how to solve this error message?</p>