Issues with the Tutorials

username: Clem_Grt
cooked: <p>Good evening,<br>
It has been a few days now i’m trying to learn PyTorch in its C++ Frontend</p>
<p>Yet Not a single tutorials works as expected :</p>
<p><strong>1. Installing C++ Distributions of PyTorch</strong></p>
<p>After a long struggle and some help I finally managed to carry out the “Installing C++ Distributions of PyTorch”… but I had to change every single line of the building process (see <a href="https://github.com/pytorch/pytorch/issues/16002" rel="noopener nofollow ugc">this GitHub issues thread </a>)</p>
<p><strong>2. The C++ Frontend</strong></p>
<p>Then I tried the “The C++ Frontend” tutorial but building it ends in 177 warnings and this error :</p>
<blockquote>
<p>“D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchFrontend\build\PyTorchFrontend.vcxproj” (cible par défaut) (1) → <br>
(ClCompile cible) → <br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/serialize.h(39): error C2679: ‘&lt;&lt;’ b<br>
inaire : aucun opérateur trouvé qui accepte un opérande de partie droite de type ‘const Value’ (ou il n’existe pas de c<br>
onversion acceptable) [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchFrontend\build\PyTorchFrontend.vcxproj]</p>
</blockquote>
<pre><code>177 Avertissement(s)
1 Erreur(s)
</code></pre>
<p><strong>3. Using the PyTorch C++ Frontend</strong></p>
<p>Finally I tried the “Using the PyTorch C++ Frontend”. Copying and pasting the cpp code also ends in<br>
180 warnings<br>
24 errors</p>
<p>Here are the errors :</p>
<blockquote>
<p>“D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj” (cible par défaut) (1) → <br>
(ClCompile cible) → <br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(99): error C2039: ‘Normalize’ : n’est pas membre<br>
de ‘torch::data::transforms’ [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(99): error C2065: ‘Normalize’ : identificateur no<br>
n déclaré [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(99): error C2059: erreur de syntaxe : ‘&gt;’ [D:\Ygg<br>
drasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(102): error C3536: ‘dataset’ : ne peut pas être u<br>
tilisé avant d’avoir été initialisé [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(101): error C2789: ‘batches_per_epoch’ : un objet<br>
de type qualifié const doit être initialisé [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcx<br>
proj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(29): error C2825:<br>
‘Dataset’ : doit être une classe ou un espace de noms lorsqu’il est suivi par ‘::’ [D:\Yggdrasil\Programmation\PyTorch<br>
Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(29): error C2510:<br>
‘Dataset’ : class/struct/union doit figurer à gauche de ‘::’ [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN<br>
\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(29): error C2061:<br>
erreur de syntaxe : identificateur ‘BatchType’ [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.v<br>
cxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(68): error C2065:<br>
‘Batch’ : identificateur non déclaré [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(68): error C2923:<br>
‘torch::data::Iterator’ : ‘Batch’ n’est pas un argument de type modèle valide pour le paramètre ‘Batch’ [D:\Yggdrasil\P<br>
rogrammation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(80): error C2065:<br>
‘Batch’ : identificateur non déclaré [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(80): error C2923:<br>
‘torch::data::Iterator’ : ‘Batch’ n’est pas un argument de type modèle valide pour le paramètre ‘Batch’ [D:\Yggdrasil\P<br>
rogrammation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(182): error C2065:<br>
‘Batch’ : identificateur non déclaré [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(182): error C2923:<br>
‘c10::optional’ : ‘Batch’ n’est pas un argument de type modèle valide pour le paramètre ‘T’ [D:\Yggdrasil\Programmatio<br>
n\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(144): error C2061:<br>
erreur de syntaxe : identificateur ‘Batch’ [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxp<br>
roj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(144): error C2535:<br>
‘torch::data::DataLoader&lt;int,torch::data::samplers::RandomSampler&gt;::Result::Result(void)’ : fonction membre déjà défin<br>
ie ou déclarée [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(147): error C2065:<br>
‘Batch’ : identificateur non déclaré [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\libtorch\include\torch\csrc\api\include\torch/data/dataloader.h(147): error C2923:<br>
‘c10::optional’ : ‘Batch’ n’est pas un argument de type modèle valide pour le paramètre ‘T’ [D:\Yggdrasil\Programmatio<br>
n\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(124): error C2514: ‘torch::data::Iterator’ : la c<br>
lasse n’a aucun constructeur [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(124): error C2678: ‘!=’ binaire : aucun opérateur<br>
trouvé qui accepte un opérande de partie gauche de type ‘torch::data::Iterator’ (ou il n’existe pas de conversion acce<br>
ptable) [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(124): error C2678: ‘++’ binaire : aucun opérateur<br>
trouvé qui accepte un opérande de partie gauche de type ‘torch::data::Iterator’ (ou il n’existe pas de conversion acce<br>
ptable) [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(124): error C2678: ‘*’ binaire : aucun opérateur<br>
trouvé qui accepte un opérande de partie gauche de type ‘torch::data::Iterator’ (ou il n’existe pas de conversion accep<br>
table) [D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(124): error C2100: indirection non conforme [D:\Y<br>
ggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]<br>
D:\Yggdrasil\Programmation\PyTorch\Tutoriels\PyTorchDCGAN\dcgan.cpp(124): error C2440: ‘initialisation’ : impossible<br>
de convertir de ‘torch::data::Iterator’ en ‘torch::data::Example<a>at::Tensor,at::Tensor</a> &amp;’ [D:\Yggdrasil\Programmation<br>
PyTorch\Tutoriels\PyTorchDCGAN\build\dcgan.vcxproj]</p>
</blockquote>
<pre><code>180 Avertissement(s)
24 Erreur(s)
</code></pre>
<p>My OS is Windows 10</p>
<p>I know this subject might not be for beginners in PyTorch but I don’t understand why the tutorials doesn’t work… Is anybody else experiencing the problems ?</p>
<p>Thanks for your interest</p>

username: chenglu
cooked: <p>+1 here.  The PyTorch 1.0 has released a coupon of weeks and C++ is the most import part of it according to the release note. But I don’t think C++ of PyTorch is ready for production or even development.</p>

username: Clem_Grt
cooked: <p>So the only worthy question here is : How can we help at our on level ?</p>

username: chauhankaranraj
cooked: <p>Were you able to resolve the issue? The DCGAN tutorial works fine for me.</p>

username: Clem_Grt
cooked: <p>Sorry for the very late answer but no, I couldn’t. I gave it up and got back to Python… for now</p>