How to Solve NameError: name 'ops' is not defined -- tensorflow

Solution: Import the 'ops' module

To Solve the error, add the following line to the top of your code.

from tensorflow.python.framework import ops

 

For more information:
Python tensorflow ops