【发布时间】:2021-06-16 10:12:40
【问题描述】:
我正在学习 TensorFlow,现在当我尝试使用以下代码在 google colab 中生成图形时
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 colab 将图形文件保存在计算机文件夹(或驱动器中)?
【问题讨论】:
-
你研究过这个错误吗?笔记本左侧的“文件”图标不显示文件列表吗?你想在那里保存吗?和 tensorflow 一点关系都没有。
-
我研究了这个错误,但我找不到问题的解决方案,它显示了一个目录路径,我正在尝试将文件保存在“Grafos”目录中我试图放两个反斜杠或放置一个普通的斜杠,例如:C:\\Users\\LUCINALDO\\Desktop\\xampp\\htdocs\\Deep Learning\\Grafos 或 C:/Users/LUCINALDO/Desktop/xampp/htdocs/Deep Learning/ Grafos 它不会给出这样的错误,但它也不会保存带有可见图形的文件。我的问题是:如何使用 google colab 做到这一点?
标签: python google-colaboratory writer