Pytorch and titan v

username: spnova12
cooked: <p>I am installing ‘pytorch’ on the computer where ‘titan v’ is installed.</p>
<p>This is what i used.</p>
<blockquote>
<p>Linux ubuntu 18.04<br>
pytorch 0.4.1<br>
cuda 9.2</p>
</blockquote>
<p>And I confirmed that the basic example code (gpu version) provided by ‘pytorch’ works well.<br>
But when i run my code, the following error has occurred.</p>
<p><strong># RuntimeError “sizes must be non-negative”</strong></p>
<p>My code works fine in “cuda 8.0, torch 0.4.0”.<br>
What should I do?<br>
Should i need to change version for pytorch or cuda?<br>
Or win10 is better to use titanv then linux…? (I’m comfortable with ‘win10’)</p>

username: albanD
cooked: <p>Hi,</p>
<p>This looks like an unrelated error. Are you sure you did not changed anything in your code/input?<br>
Could you give some context on where the error is raised?</p>

username: spnova12
cooked: <p>Thank you. I need check my code again.</p>
<p>But, I have repeated the process of deleting and installing various versions. As a result, there seems to be a problem of conflicting versions.</p>
<p>If you do not mind, I would be grateful if you could recommend a blog that is well documented for installing the “graphics driver” and “Kuda” on Linux for titna v. I am not familiar with Linux, so I suspect that I installed it properly … Thank you.</p>
<p>The address below is for my reference.<br>
<aside class="onebox stackexchange">
  <header class="source">
      <a href="https://askubuntu.com/questions/1028830/how-do-i-install-cuda-on-ubuntu-18-04" target="_blank" rel="nofollow noopener">askubuntu.com</a>
  </header>
  <article class="onebox-body">
      <a href="https://askubuntu.com/users/423377/gabs" target="_blank" rel="nofollow noopener">
    <img alt="Gabs" src="https://i.stack.imgur.com/8azHH.jpg?s=128&amp;g=1" class="thumbnail onebox-avatar" width="128" height="128">
  </a>
<h4>
  <a href="https://askubuntu.com/questions/1028830/how-do-i-install-cuda-on-ubuntu-18-04" target="_blank" rel="nofollow noopener">How do I Install CUDA on Ubuntu 18.04?</a>
</h4>

<div class="tags">
  <strong>nvidia, cuda, 18.04</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://askubuntu.com/users/423377/gabs" target="_blank" rel="nofollow noopener">
    Gabs
  </a>
  on <a href="https://askubuntu.com/questions/1028830/how-do-i-install-cuda-on-ubuntu-18-04" target="_blank" rel="nofollow noopener">03:28PM - 27 Apr 18</a>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
<aside class="onebox whitelistedgeneric">
  <header class="source">
      <img src="https://assets-cdn.github.com/favicon.ico" class="site-icon" width="32" height="32">
      <a href="https://github.com/pytorch/ELF" target="_blank" rel="nofollow noopener">GitHub</a>
  </header>
  <article class="onebox-body">
    <img src="https://avatars2.githubusercontent.com/u/21003710?s=400&amp;v=4" class="thumbnail onebox-avatar" width="400" height="400">

<h3><a href="https://github.com/pytorch/ELF" target="_blank" rel="nofollow noopener">pytorch/ELF</a></h3>

<p>ELF: a platform for game research with AlphaGoZero/AlphaZero reimplementation - pytorch/ELF</p>


  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
</p>

username: albanD
cooked: <p>The instructions to install Cuda look right.<br>
Make sure to <code>pip uninstall torch</code> before reinstalling it.<br>
But here again, there is 99% chance that this is a bug in your code (or the inputs/dataset) and not an installation problem.</p>

username: spnova12
cooked: <p>I really appreciate you very, very much. Thank you!</p>

username: DaTtoYM
cooked: <p>Traceback (most recent call last):<br>
File “train.py”, line 322, in <br>
main()<br>
File “train.py”, line 314, in main<br>
train_model(model, data, optim, i, params)<br>
File “train.py”, line 119, in train_model<br>
for src, tgt, src_len, tgt_len, original_src, original_tgt in trainloader:<br>
File “/home/mu/.conda/envs/dym/lib/python3.5/site-packages/torch/utils/data/dataloader.py”, line 314, in <strong>next</strong><br>
batch = self.collate_fn([self.dataset[i] for i in indices])<br>
File “/home/mu/global-encoding/utils/data_helper.py”, line 84, in padding<br>
src_pad = torch.zeros(len(src), max(src_len)).long()<br>
RuntimeError: sizes must be non-negative<br>
it’s my error ,I don’t know how to solve it</p>

username: albanD
cooked: <p>I guess <code>max(src_len)</code> is negative and a tensor with a negative size does not make sense,.</p>