GPModel is not defined

username: Desire
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/b/4/b43d7dd2d68d7bf122d0b1d992a5ec750fc0ac13.png" data-download-href="https://discuss.pytorch.org/uploads/default/b43d7dd2d68d7bf122d0b1d992a5ec750fc0ac13" title="Screenshot 2023-05-05 220942"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/b/4/b43d7dd2d68d7bf122d0b1d992a5ec750fc0ac13_2_666x500.png" alt="Screenshot 2023-05-05 220942" data-base62-sha1="pItGKR18WJuUZfTQt7GHhplwWSD" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/b/4/b43d7dd2d68d7bf122d0b1d992a5ec750fc0ac13_2_666x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/b/4/b43d7dd2d68d7bf122d0b1d992a5ec750fc0ac13_2_999x750.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/b/4/b43d7dd2d68d7bf122d0b1d992a5ec750fc0ac13.png 2x" data-dominant-color="F7F7F7"><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">Screenshot 2023-05-05 220942</span><span class="informations">1064×798 66.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>
Hi,</p>
<p>Please, I build and pretrained this model and i was successful in saving the model correctly in the same jupyter notebook where i built the model as shown in the snippet but when i tried to load the model using the last code in the last cell of the snippet in a new notebook to make predictions, it keeps on giving the output that the GPModel is not defined. I would be delighted if anyone could kindly help.</p>

username: ptrblck
cooked: <p>Your screenshot doesn’t show any error message as I’m unsure what exactly is failing. Could you add more information about the actual failure?<br>
PS: you can post code snippets by wrapping them into three backticks ```.</p>

username: Desire
cooked: <p>The second snippet is the output i got when trying to load and use the model in  anew notebook.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/5/c5b44df0d2933b28822b1370fa2754b84bae01be.png" data-download-href="https://discuss.pytorch.org/uploads/default/c5b44df0d2933b28822b1370fa2754b84bae01be" title="Screenshot 2023-05-05 221523"><img src="https://discuss.pytorch.org/uploads/default/original/3X/c/5/c5b44df0d2933b28822b1370fa2754b84bae01be.png" alt="Screenshot 2023-05-05 221523" data-base62-sha1="scYmsgT787iReQGFC7tNw82w7NA" width="690" height="225" data-dominant-color="EFDEDD"><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">Screenshot 2023-05-05 221523</span><span class="informations">719×235 17.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></p>

username: Desire
cooked: <p>Hello, i am just wondering if anyone knows what the problem could have been. Thanks.</p>

username: ptrblck
cooked: <p>You would need to define the model or import it’s definition as seen in the first picture assuming you are not doing so in previous cells.</p>

username: Desire
cooked: <p>Thank you for replying but i would like to ask how i could do this</p>

username: ptrblck
cooked: <p>Copy the <code>class GPModel</code> definition from your first screenshot into your other script.</p>