Ask Help for optimizer for Torch 1.3.0

username: yangyi_hpu
cooked: <p>I install the Torch 1.3.0. I think it is different with my before version. Now I meet two problem about optimal<br>
My network is in Net1.py</p>
<p>class Net(nn.Module):<br>
def <strong>init</strong>(self):<br>
super(Net, self).<strong>init</strong>()<br>
self.conv1 = nn.Conv2d(1, 32, 3, 1)<br>
self.conv2 = nn.Conv2d(32, 64, 3, 1)<br>
self.dropout1 = nn.Dropout2d(0.25)<br>
self.dropout2 = nn.Dropout2d(0.5)<br>
self.fc1 = nn.Linear(9216, 128)<br>
self.fc2 = nn.Linear(128, 10)</p>
<pre><code>def forward(self, x):
    x = self.conv1(x)
    x = F.relu(x)
    x = self.conv2(x)
    x = F.max_pool2d(x, 2)
    x = self.dropout1(x)
    x = torch.flatten(x, 1)
    x = self.fc1(x)
    x = F.relu(x)
    x = self.dropout2(x)
    x = self.fc2(x)
    output = F.log_softmax(x, dim=1)
    return output
</code></pre>
<p>The main function as below<br>
import Net1<br>
net = <a href="http://Net1.Net" rel="nofollow noopener">Net1.Net</a>()<br>
optimizer = torch.optim.Adam(net.parameters(), lr=0.05)</p>
<p>the two problems come from the above code<br>
(1) I want to use the Adadelta as the optimizer, but torch.optim.Adadelta cannot find<br>
(2) Despite I use Adam as the optimizer, but the net.parameters() cannot found too.<br>
I works in pyCharm, so I install torch in the pyCharm environment, I thought that maybe because the pyCharm cannot install the torch code completely, so I use the pip3 method to install the torch. And the problems is still here.<br>
Please help me!  Thank you very very much.</p>

username: ptrblck
cooked: <ol>
<li>
<p>What kind of error message do you get? <a href="https://pytorch.org/docs/1.3.0/optim.html?highlight=adadelta#torch.optim.Adadelta">torch.optim.Adadelta</a> is available in <code>1.3.0</code>.</p>
</li>
<li>
<p>Again, what kind of error do you get that you think the parameters cannot be found?</p>
</li>
</ol>

username: yangyi_hpu
cooked: <p>Thank you very much for your reply.<br>
Acctrually, the error is the same.</p>
<p>for the following code :<br>
optimizer = torch.optim.Adadelt(net.parameters(), lr=0.05)</p>
<p>under the “Adadelt” there is underlines, and say:“Cannot find reference ‘Adadelt’ in  <em>init</em> .py”. And I check the “ <em>init</em> .py”, the Adadelt is not here</p>
<p>under the “parameters()” the underlines says"Cannont find reference ‘parameters’ in (input:(Any,…))"</p>

username: ptrblck
cooked: <p>Maybe you just have a typo and you have written <code>Adadelt</code> instead of <code>Adadelta</code>?</p>
<p>However, is this just a warning from your IDE or a real error?</p>

username: yangyi_hpu
cooked: <p>Thank you very much. I make spelling mistake about Adadelta in this place. But in my code the word is right. There is no waringing or error when I running the code. Sorry, I just find there is a underline belowe the “Adadelta” and “parameters()” with the index information. I am worried about this index information would result in some mistakes that cannot be found in syntax.<br>
Thank you again.</p>

username: ptrblck
cooked: <p>What kind of index information do you get?<br>
I guess it might be a warning by PyCharm, as it probably cannot resolve some symbols and thus could yield some warnings. Could this be the case?</p>

username: yangyi_hpu
cooked: <p>Thank you very much.<br>
(1)The index information for net.parameters() is “Cannot find reference ‘parameters’ in (input:Any,…),kwargs:dict)-&gt;Any”<br>
(2) The index information for “.Adadelta” is “Cannont find reference ‘Adadelta’ in  <em>ini</em>  .pyi”.</p>
<p>I find the /usr/local/lib/python3.6/dist-packages/dis-packages/torch/optim/  <em>ini</em>  .pyi, The code is<br>
from .sgd import SGD as SGD<br>
from .adam import Adam as Adam<br>
from . import lr_scheduler as lr_scheduler</p>
<p>there is no Adadelta in the file. So, if my version is incomplete or not? I tred to install the torch by two ways: in the Pycharm intall the package, and in terminal input “sudo pip3 install torch”. The result is the same.</p>
<p>And for the net.parameters() problem, I guess if there need define a method for the parameters in my Network. In the before version, there is no need, but now I donnot know.</p>
<p>Despite the index information in pyCharm, but there is no warining or error during running. But yestoday, I trid to train the Network, the result implys there is no any improvement of my Network, so I doubt that the absent optimizer and the parameters() method.</p>
<p>Thank you very much. I do my best to solve the problem, but my knowledge for the pytorch is too little to do that. Please help me. Thank you again.</p>

username: ptrblck
cooked: <p>These are just warnings which you could ignore for now. We had a recent discussion about some improvements here in the forum, but I cannot find it.</p>
<p>As long as your code doesn’t throw any errors or warnings, you should be fine.</p>
<p>If I interpret the warning correctly, pycharm just cannot find the docs and references for these methods.</p>