# Your first GAN, notebook error

**URL:** <https://community.deeplearning.ai/t/your-first-gan-notebook-error/104237>\
**Category:** Build Basic Generative Adversarial Networks\
**Tags:** week-module-1\
**Created:** [March 1, 2022, 5:19am UTC](https://community.deeplearning.ai/t/your-first-gan-notebook-error/104237 "2022-03-01T05:19:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Hyde](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/simon_hyde/32/15600_2.png) [@Simon\_Hyde](https://community.deeplearning.ai/u/Simon_Hyde)\
**Post date:** [March 1, 2022, 5:19am UTC](https://community.deeplearning.ai/t/your-first-gan-notebook-error/104237/1 "2022-03-01T05:19:04Z")

</div>

When I run the course assignment notebook I get the following error on the third cell  
TypeError Traceback (most recent call last)  
 in   
16 assert test\_output.std() \< 0.65  
17  
—\> 18 test\_gen\_block(25, 12)  
19 test\_gen\_block(15, 28)  
 in test\_gen\_block(in\_features, out\_features, num\_test)  
1 # Verify the generator block function  
2 def test\_gen\_block(in\_features, out\_features, num\_test=1000):  
----\> 3 block = get\_generator\_block(in\_features, out\_features)  
4  
5 # Check the three parts

in get\_generator\_block(input\_dim, output\_dim)  
17 # [torch.nn — PyTorch 1.10 documentation](https://pytorch.org/docs/stable/nn.html).  
18 #### START CODE HERE ####  
—\> 19 nn.Linear(None, None),  
20 nn.BatchNorm1d(None),  
21 #### END CODE HERE ####

/usr/local/lib/python3.6/dist-packages/torch/nn/modules/linear.py in **init** (self, in\_features, out\_features, bias)  
70 self.in\_features = in\_features  
71 self.out\_features = out\_features  
—\> 72 self.weight = Parameter(torch.Tensor(out\_features, in\_features))  
73 if bias:  
74 self.bias = Parameter(torch.Tensor(out\_features))

TypeError: new() received an invalid combination of arguments - got (NoneType, NoneType), but expected one of:

- (torch.device device)
- (torch.Storage storage)
- (Tensor other)
- (tuple of ints size, torch.device device)  
didn’t match because some of the arguments have invalid types: (!NoneType!, !NoneType!)
- (object data, torch.device device)  
didn’t match because some of the arguments have invalid types: (!NoneType!, !NoneType!)

Is fixing it part of the assignment?

---

<div class="post-metadata">

**Author:** ![Simon\_Hyde](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/simon_hyde/32/15600_2.png) [@Simon\_Hyde](https://community.deeplearning.ai/u/Simon_Hyde)\
**Post date:** [March 1, 2022, 9:41am UTC](https://community.deeplearning.ai/t/your-first-gan-notebook-error/104237/2 "2022-03-01T09:41:17Z")

</div>

Opps I see what is happening!
