我正在学习TensorFlow,现在当我尝试用下面的代码在google中生成图形时
import tensorflow as tf
a = tf.add(2, 2, name='add')
b = tf.multiply(a, 3, name ='mult1')
c = tf.multiply(b, a, name='mult2')
print(c.numpy())
tf.compat.v1.get_default_graph()
writer = tf.summary.create_file_writer('C:\Users\LUCINALDO\Desktop\xampp\htdocs\Deep Learning\Grafos')
a = tf.add(2, 2, name='add')
b = tf.multiply(a, 3, name ='mult1')
c = tf.multiply(b, a, name='mult2')
writer.close()向我展示了以下错误消息
File "<ipython-input-20-a289120d76db>", line 11
writer = tf.summary.create_file_writer('C:\Users\LUCINALDO\Desktop\xampp\htdocs\Deep Learning\Grafos')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape如何使用google将图形文件保存在计算机文件夹(或驱动器中)?
发布于 2021-03-23 13:30:36
我能像你看到的那样拯救它。
import tensorflow as tf
a = tf.add(2, 2, name='add')
b = tf.multiply(a, 3, name ='mult1')
c = tf.multiply(b, a, name='mult2')
print(c.numpy())
tf.compat.v1.get_default_graph()
writer = tf.summary.create_file_writer('/test')
a = tf.add(2, 2, name='add')
b = tf.multiply(a, 3, name ='mult1')
c = tf.multiply(b, a, name='mult2')
writer.close()

https://stackoverflow.com/questions/66700775
复制相似问题