# DLS course 5 assignment 3 jass improv dj model

**URL:** <https://community.deeplearning.ai/t/dls-course-5-assignment-3-jass-improv-dj-model/329850>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [May 9, 2023, 1:24am UTC](https://community.deeplearning.ai/t/dls-course-5-assignment-3-jass-improv-dj-model/329850 "2023-05-09T01:24:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zac\_builta](https://avatars.discourse-cdn.com/v4/letter/z/82dd89/32.png) [@zac\_builta](https://community.deeplearning.ai/u/zac_builta)\
**Post date:** [May 9, 2023, 1:24am UTC](https://community.deeplearning.ai/t/dls-course-5-assignment-3-jass-improv-dj-model/329850/1 "2023-05-09T01:24:52Z")

</div>

I have this very long error message that I’m not sure about. The pieces of code that i’m most concerned about.(Not necessarily positive they are the culprits for this error message) are when I select the t’th example from X, as in X[Tx, t] I do this because its asking to slice at t in the place of n\_a which is the second index of X. I then use x = reshaper(x) but get this error.

How do I open this assignment up brand new? I’m afraid that I have edited some code that was outside of the part I was supposed to mess with. So I’d like to just look at a blank one to make sure everything is still the way its supposed to be.

heres the error. Thanks

* * *

InvalidArgumentError Traceback (most recent call last)  
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in \_create\_c\_op(graph, node\_def, inputs, control\_inputs, op\_def)  
1811 try:  
 → 1812 c\_op = pywrap\_tf\_session.TF\_FinishOperation(op\_desc)  
1813 except errors.InvalidArgumentError as e:

InvalidArgumentError: Cannot reshape a tensor with 90 elements to shape [90,1,90] (8100 elements) for ‘{{node reshape\_1/Reshape}} = Reshape[T=DT\_FLOAT, Tshape=DT\_INT32](strided\_slice\_1, reshape\_1/Reshape/shape)’ with input shapes: [90], [3] and with input tensors computed as partial shapes: input[1] = [90,1,90].

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)  
 in   
----\> 1 model = djmodel(Tx=30, LSTM\_cell=LSTM\_cell, densor=densor, reshaper=reshaper)

in djmodel(Tx, LSTM\_cell, densor, reshaper)  
42 x = X[Tx, t]  
43 # Step 2.B: Use reshaper to reshape x to be (1, n\_values) (≈1 line)  
—\> 44 x = reshaper(x)  
45  
46 # Step 2.C: Perform one step of the LSTM\_cell

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base\_layer.py in **call** (self, \*args, \*\*kwargs)  
924 if \_in\_functional\_construction\_mode(self, inputs, args, kwargs, input\_list):  
925 return self.\_functional\_construction\_call(inputs, args, kwargs,  
 → 926 input\_list)  
927  
928 # Maintains info about the `Layer.call` stack.

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base\_layer.py in \_functional\_construction\_call(self, inputs, args, kwargs, input\_list)  
1115 try:  
1116 with ops.enable\_auto\_cast\_variables(self.\_compute\_dtype\_object):  
 → 1117 outputs = call\_fn(cast\_inputs, \*args, \*\*kwargs)  
1118  
1119 except errors.OperatorNotAllowedInGraphError as e:

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/core.py in call(self, inputs)  
538 def call(self, inputs):  
539 result = array\_ops.reshape(  
 → 540 inputs, (array\_ops.shape(inputs)[0],) + self.target\_shape)  
541 if not context.executing\_eagerly():  
542 # Set the static shape for the result since it might lost during array\_ops

/opt/conda/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py in wrapper(\*args, \*\*kwargs)  
199 “”“Call target, and fall back on dispatchers if there is a TypeError.”“”  
200 try:  
 → 201 return target(\*args, \*\*kwargs)  
202 except (TypeError, ValueError):  
203 # Note: convert\_to\_eager\_tensor currently raises a ValueError, not a

/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/array\_ops.py in reshape(tensor, shape, name)  
193 A `Tensor`. Has the same type as `tensor`.  
194 “”"  
 → 195 result = gen\_array\_ops.reshape(tensor, shape, name)  
196 tensor\_util.maybe\_set\_static\_shape(result, shape)  
197 return result

/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/gen\_array\_ops.py in reshape(tensor, shape, name)  
8232 # Add nodes to the TensorFlow graph.  
8233 \_, \_, \_op, \_outputs = \_op\_def\_library.\_apply\_op\_helper(  
 → 8234 “Reshape”, tensor=tensor, shape=shape, name=name)  
8235 \_result = \_outputs[:]  
8236 if \_execute.must\_record\_gradient():

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/op\_def\_library.py in \_apply\_op\_helper(op\_type\_name, name, \*\*keywords)  
742 op = g.\_create\_op\_internal(op\_type\_name, inputs, dtypes=None,  
743 name=scope, input\_types=input\_types,  
 → 744 attrs=attr\_protos, op\_def=op\_def)  
745  
746 # `outputs` is returned as a separate return value so that the output

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/func\_graph.py in \_create\_op\_internal(self, op\_type, inputs, dtypes, input\_types, name, attrs, op\_def, compute\_device)  
591 return super(FuncGraph, self).\_create\_op\_internal( # pylint: disable=protected-access  
592 op\_type, inputs, dtypes, input\_types, name, attrs, op\_def,  
 → 593 compute\_device)  
594  
595 def capture(self, tensor, name=None, shape=None):

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in \_create\_op\_internal(self, op\_type, inputs, dtypes, input\_types, name, attrs, op\_def, compute\_device)  
3483 input\_types=input\_types,  
3484 original\_op=self.\_default\_original\_op,  
 → 3485 op\_def=op\_def)  
3486 self.\_create\_op\_helper(ret, compute\_device=compute\_device)  
3487 return ret

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in **init** (self, node\_def, g, inputs, output\_types, control\_inputs, input\_types, original\_op, op\_def)  
1973 op\_def = self.\_graph.\_get\_op\_def(node\_def.op)  
1974 self.\_c\_op = \_create\_c\_op(self.\_graph, node\_def, inputs,  
 → 1975 control\_input\_ops, op\_def)  
1976 name = compat.as\_str(node\_def.name)  
1977 # pylint: enable=protected-access

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in \_create\_c\_op(graph, node\_def, inputs, control\_inputs, op\_def)  
1813 except errors.InvalidArgumentError as e:  
1814 # Convert to ValueError for backwards compatibility.  
 → 1815 raise ValueError(str(e))  
1816  
1817 return c\_op

ValueError: Cannot reshape a tensor with 90 elements to shape [90,1,90] (8100 elements) for ‘{{node reshape\_1/Reshape}} = Reshape[T=DT\_FLOAT, Tshape=DT\_INT32](strided\_slice\_1, reshape\_1/Reshape/shape)’ with input shapes: [90], [3] and with input tensors computed as partial shapes: input[1] = [90,1,90].

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [May 9, 2023, 2:57am UTC](https://community.deeplearning.ai/t/dls-course-5-assignment-3-jass-improv-dj-model/329850/2 "2023-05-09T02:57:42Z")

</div>

See the first Topic in this FAQ thread:

> [@FAQ: Frequently Asked Questions for all DLS Courses](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74):
>
> Here is a list of Frequently Asked Questions about the DLS Courses, the assignments and other course related topics. Topics [Get a clean copy of an assignment](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-is-there-a-way-to-restore-one-of-my-assignment-notebooks-to-its-original-state-2)[All my previous work has disappeared!](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-help-all-my-previous-work-has-disappeared-from-one-of-my-notebooks-3)[Name errors on predefined functions](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-nameerror-name-sigmoid_derivative-is-not-defined-4)[When to use np.multiply or np.dot](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-how-do-i-know-whether-to-use-npmultiply-or-npdot-5)[Missing “Submit Assignment” button](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-there-is-no-submit-assignment-button-in-my-notebook-6)[Source code for utility functions](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-how-can-i-find-the-source-for-utility-functions-invoked-by-the-notebook-7)[Access to assignments after completing the courses](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-will-i-be-able-to-access-my-completed-assignments-after-i-finish-the-courses-8)[Managing course deadlines](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-is-it-possible-to-reset-the-course-deadlines-9)[ML/DL textbooks](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-are-there-recommended-textbooks-that-cover-the-material-in-this-course-10)[Derivation of back propagation](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-where-can-i-find-more-information-about-the-derivation-of-the-back-propagation-formulas-11)[Symmetry Breaking](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-why-is-symmetry-breaking-required-12)[Formatting mathematic…](https://community.deeplearning.ai/t/faq-frequently-asked-questions-for-all-dls-courses/74#p-142-how-can-i-format-mathematical-formulas-in-a-discourse-post-13)

---

<div class="post-metadata">

**Author:** ![zac\_builta](https://avatars.discourse-cdn.com/v4/letter/z/82dd89/32.png) [@zac\_builta](https://community.deeplearning.ai/u/zac_builta)\
**Post date:** [May 9, 2023, 3:02am UTC](https://community.deeplearning.ai/t/dls-course-5-assignment-3-jass-improv-dj-model/329850/3 "2023-05-09T03:02:04Z")

</div>

Thanks you for the link!
