Hi,
I am trying to run imdb.ipynb(from dl2 lesson 10) and I have reached the ‘wikitext103 conversion’ topic’s last cell.
wgts['0.encoder.weight'] = T(new_w)
wgts['0.encoder_with_dropout.embed.weight'] = T(np.copy(new_w))
wgts['1.decoder.weight'] = T(np.copy(new_w))
But it gives this error:
NameError Traceback (most recent call last)
<ipython-input-294-678a783a7cd5> in <module>()
----> 1 wgts['0.encoder.weight'] = T(new_w)
2 wgts['0.encoder_with_dropout.embed.weight'] = T(np.copy(new_w))
3 wgts['1.decoder.weight'] = T(np.copy(new_w))
NameError: name 'T' is not defined
Basically, it can’t find the function T()
Here is all what I have imported:
from fastai.text import *
import html
import os
from pathlib import Path
import pandas as pd
import numpy as np
import scipy
import sklearn
import sklearn.model_selection
import re
import torch
What all have I tried doing?
I have searched about this on the internet but I can’t find anything about the function “T()”
I came to know about numpy.ndarray.T which is an Attribute which transposes the ndarray but there is no function “T()” anywhere.
I also searched in fastai repo using git search but I couldn’t find it. I think it’s a function from fastai or torch and I am not sure what exactly it does.
Can somebody please help?