Problem while checking the parameters #226
Unanswered
maxlelyonais
asked this question in
Q&A
Replies: 1 comment
-
Seems you mispelled |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Good Morning/Evening/Night.
This error appeared while I was doing the course. I don't know if I mispelled something or it is from the program.
This is the code:
Create a random seed
torch.manual_seed(42)
#Create an instance of the model ( this is a subclass of nn.Module)
model_0 = LinearRegressionModel()
#Check out the parameters
model_0.parameters()
And this is the error:
TypeError Traceback (most recent call last)
in
4 #Create an instance of the model ( this is a subclass of nn.Module)
5
----> 6 model_0 = LinearRegressionModel()
7
8 #Check out the parameters
in init(self)
9 requires_grad=True,
10 dtype=torch.float)) ## Create a weight parameter
---> 11 self.bias = nn.Parameter(torch.randn(1,
12 required_grad = True,
13 dtype = torch.float))
TypeError: randn() received an invalid combination of arguments - got (int, dtype=torch.dtype, required_grad=bool), but expected one of:
Beta Was this translation helpful? Give feedback.
All reactions