'Python requires_grad_ is not supported on ScriptModule

I tried running code from this link: https://towardsdatascience.com/how-i-built-an-ai-text-to-art-generator-a0c0f6d6f59f but I get this error when running the code:

RuntimeError: requires_grad_ is not supported on ScriptModule

This is the colab link: https://colab.research.google.com/drive/1sf9I2Wg8c_mwwDwM3mGsIW3zLWOmA7xG?usp=sharing

On the internet I found that for some people it worked by installing pytorch==0.10.0, i tried this but it did not fix the issue. Could anyone help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source