akankshakshurai/cuda-error-resolution-analysis huggingface dataset:
Library not loaded: @rpath/libc++.1.dylib

username: Shan_Zhang
cooked: <p>Here is the problem:</p>
<p>Traceback (most recent call last):<br>
File “app.py”, line 52, in <br>
from system.model_optimization.optimization import create_database_table, extract_database_stock, extract_database_rf<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/system/model_optimization/optimization.py”, line 2, in <br>
from pypfopt.efficient_frontier import EfficientFrontier<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/pypfopt/<strong>init</strong>.py”, line 1, in <br>
from .black_litterman import (<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/pypfopt/black_litterman.py”, line 13, in <br>
from . import base_optimizer<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/pypfopt/base_optimizer.py”, line 14, in <br>
import cvxpy as cp<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/<strong>init</strong>.py”, line 18, in <br>
from cvxpy.atoms import *<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/atoms/<strong>init</strong>.py”, line 20, in <br>
from cvxpy.atoms.geo_mean import geo_mean<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/atoms/geo_mean.py”, line 20, in <br>
from cvxpy.utilities.power_tools import (fracify, decompose, approx_error, lower_bound,<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/utilities/power_tools.py”, line 18, in <br>
from cvxpy.atoms.affine.reshape import reshape<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/atoms/affine/reshape.py”, line 18, in <br>
from cvxpy.atoms.affine.hstack import hstack<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/atoms/affine/hstack.py”, line 19, in <br>
from cvxpy.atoms.affine.affine_atom import AffAtom<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/atoms/affine/affine_atom.py”, line 22, in <br>
from cvxpy.cvxcore.python import canonInterface<br>
File “/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/cvxpy/cvxcore/python/<strong>init</strong>.py”, line 3, in <br>
import _cvxcore<br>
ImportError: dlopen(/Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/_cvxcore.cpython-37m-darwin.so, 2): Library not loaded: <span class="mention">@rpath</span>/libc++.1.dylib<br>
Referenced from: /Users/zhangshan/Documents/FRE_Project/FRE_Platform/venv/lib/python3.7/site-packages/_cvxcore.cpython-37m-darwin.so<br>
Reason: image not found</p>
<p>My PC is MacOS by the way.<br>
Any ideas?</p>
Losses in Fasterrcnn end up becoming NAN during training.Why the model returning nan as output's Loss?

username: zkz
cooked: <p>I replaced L1-smooth Loss in bounding box refinement state with IoU Loss and GIoU Loss in Fasterrcnn,but the result of class_loss ,regression_loss,rpn_class_loss and rpn_bbox_regression_loss  is Nan.Thus,Fasterrcnn is stopping train. I use the same parameters as L1-smooth Loss.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/d/3df3b92eab0d14bfa7d839afd2c4d2af3da42e70.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/3df3b92eab0d14bfa7d839afd2c4d2af3da42e70" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/d/3df3b92eab0d14bfa7d839afd2c4d2af3da42e70_2_548x499.jpeg" alt="image" data-base62-sha1="8Q3iDwMQuD5UwLHXAHeeG0Brntm" width="548" height="499" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/d/3df3b92eab0d14bfa7d839afd2c4d2af3da42e70_2_548x499.jpeg, https://discuss.pytorch.org/uploads/default/original/3X/3/d/3df3b92eab0d14bfa7d839afd2c4d2af3da42e70.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/3/d/3df3b92eab0d14bfa7d839afd2c4d2af3da42e70.jpeg 2x" data-dominant-color="F8F8F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">764×696 117 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
debug is Nan</p>

username: zkz
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/a/fa924f5163ac5ba3f5eb8fc54ab831a554a12d03.png" data-download-href="https://discuss.pytorch.org/uploads/default/fa924f5163ac5ba3f5eb8fc54ab831a554a12d03" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/a/fa924f5163ac5ba3f5eb8fc54ab831a554a12d03_2_690x258.png" alt="image" data-base62-sha1="zKEPLHmIKQII0dzfZbfNDDdzfUv" width="690" height="258" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/a/fa924f5163ac5ba3f5eb8fc54ab831a554a12d03_2_690x258.png, https://discuss.pytorch.org/uploads/default/original/3X/f/a/fa924f5163ac5ba3f5eb8fc54ab831a554a12d03.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/f/a/fa924f5163ac5ba3f5eb8fc54ab831a554a12d03.png 2x" data-dominant-color="EBEEF3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1020×382 58.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
This my result of debug!</p>
LSTM.weight_ih_l[k] dimensions with proj_size

username: mrityu
cooked: <p>According to Pytorch <a href="https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html" rel="noopener nofollow ugc">LSTM documentation</a> :-</p>
<ul>
<li>
<strong>~LSTM.weight_ih_l[k]</strong> – the learnable input-hidden weights of the kth\text{k}^{th}kth layer (W_ii|W_if|W_ig|W_io), of shape (4*hidden_size, input_size) for k = 0. Otherwise, the shape is (4 * hidden_size, num_directions * hidden_size)</li>
</ul>
<p>My doubt is, why for <code>k &gt; 0</code>  the shape for each weight is <code>(hidden_size, num_directions * hidden_size)</code>, according to me, shouldn’t be <code>(hidden_size, num_directions * proj_size)</code>  because the layer above the lowest layer is receiving the input which is the output of the lowest layer which have the shape of <code>(L, N, num_directions*proj_size)</code></p>

username: mrityu
cooked: <p>The dimensions in the doc will be updated very soon.</p>
<p><a href="https://github.com/pytorch/pytorch/issues/65053#issuecomment-920348776" rel="noopener nofollow ugc">Github Issue</a></p>
/usr/bin/python: No module named torch.distributed

username: jiafan
cooked: <p>I’m using torch in WSL (Windows Subsystem for Linux). I installed torch and torchvision, but still got error when I tried to use torch.distributed:<br>
/usr/bin/python: No module named torch.distributed</p>
<p>Maybe it doesn’ support WSL?</p>

username: mszhanyi
cooked: <p>I tried on WSL2 with cuda.<br>
It supports torch.distributed.<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/0/a/0a51eb86546a14177bb4d6da87698812e0cea2a6.png" alt="image" data-base62-sha1="1tihPhxBKRuBWlQYJzkOQzFoDDE" width="578" height="115"></p>

username: mszhanyi
cooked: <p>Please type <code>wsl -l -v</code> to check your wsl status</p>

username: mszhanyi
cooked: <p>It works on WSL2 with Windows CPU machine too</p>

username: jiafan
cooked: <p>Thank you <a class="mention" href="/u/mszhanyi">@mszhanyi</a> . I’m using WSL 1 <img src="https://discuss.pytorch.org/images/emoji/apple/frowning.png?v=10" title=":frowning:" class="emoji" alt=":frowning:"></p>

username: mszhanyi
cooked: <p>WSL1 doesn’t support GPU.<br>
But I think if you install pytorch cpu version, the torch.distributed should be available too.</p>

username: rvarm1
cooked: <p>Did you build PyTorch with USE_DISTRIBUTED=1?</p>
Onnx export does not work with model that takes tuple as input

username: yncxcw
cooked: <p>This piece of code doesn’t work as the model takes a tuple as input.</p>
<pre><code class="lang-python">import torch
from typing import Tuple

class TupleModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self._ln1 = torch.nn.Linear(5, 3)
        self._ln2 = torch.nn.Linear(5, 3)

    def forward(self, x: Tuple[torch.Tensor]):
        print(type(x))
        y1 = self._ln1(x[0])
        y2 = self._ln2(x[1])
        return y1, y2

model = TupleModel()
inputs = (torch.zeros([1, 5]), torch.zeros(1, 5))
model(inputs)
assert type(inputs) == tuple
torch.onnx.export(
    model,
    inputs,
    "/tmp/model.onnx",
    input_names=["input1", "input2"],
    output_names=["output1", "output2"],
)
</code></pre>
<p>I got this error:</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "test.py", line 25, in &lt;module&gt;
    output_names=["output1", "output2"],
  File "/home/wei/.local/lib/python3.6/site-packages/torch/onnx/__init__.py", line 276, in export
    custom_opsets, enable_onnx_checker, use_external_data_format)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 94, in export
    use_external_data_format=use_external_data_format)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 698, in _export
    dynamic_axes=dynamic_axes)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 456, in _model_to_graph
    use_new_jit_passes)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 417, in _create_jit_graph
    graph, torch_out = _trace_and_get_graph_from_model(model, args)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 377, in _trace_and_get_graph_from_model
    torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/jit/_trace.py", line 1139, in _get_trace_graph
    outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/jit/_trace.py", line 130, in forward
    self._force_outplace,
  File "/home/wei/.local/lib/python3.6/site-packages/torch/jit/_trace.py", line 116, in wrapper
    outs.append(self.inner(*trace_inputs))
  File "/home/wei/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 887, in _call_impl
    result = self._slow_forward(*input, **kwargs)
  File "/home/wei/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 860, in _slow_forward
    result = self.forward(*input, **kwargs)
</code></pre>
<p>It seems that the onnx export doesn’t take the tuple as a whole instead it takes each element of the tuple as an indivudual argment.</p>
Bug: torch.jit.load cannot load from IOBuffer

username: jacobbuckman
cooked: <p>Taking code straight from the documentation on <a href="http://man.hubwiz.com/docset/PyTorch.docset/Contents/Resources/Documents/jit.html" rel="noopener nofollow ugc">this page</a>:</p>
<pre><code class="lang-auto">import torch
import io

class MyModule(torch.nn.Module):
    def forward(self, x):
        return x + 10

m = torch.jit.script(MyModule())

# Save to io.BytesIO buffer
buffer = io.BytesIO()
torch.jit.save(m, buffer)
</code></pre>
<p>If we then run:</p>
<p><code>torch.jit.load(buffer)</code></p>
<p>We see:</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/torch/jit/_serialization.py", line 163, in load
    cpp_module = torch._C.import_ir_module_from_buffer(
RuntimeError: PytorchStreamReader failed reading zip archive: not a ZIP archive
</code></pre>
<p>This is on Mac and Linux, Python3.9, torch 1.9.0.</p>

username: Michael_Suo
cooked: <p>you probably wanto do a <code>buffer.seek(0)</code> to reset the cursor</p>