我已经使用files.upload()片段将我的train.csv和valid.csv上传到colab:
用户上传文件“valid.txt”,长度为3387762字节用户上传文件“train.txt”,长度为9401172字节
运行一些本地运行正常的tensorflow代码并获取当前目录中的文件,导致Colab中出现以下错误:
InvalidArgumentError:断言失败:[string_input_producer需要非空输入张量] [[Node:input_producer / Assert / Assert = Assert [T = [DT_STRING],summarize = 3,_device =“/ job:localhost / replica:0 / task :0 / device:CPU:0“](input_producer / Greater,input_producer / Assert / Assert / data_0)]]
我假设代码无法看到文件?上传文件的路径是什么?
1 回答
这个问题的答案有帮助吗?
How to import and read a shelve or Numpy file in Google Colaboratory?
(
files.upload
将上传的文件存储在内存中 . 要将它们作为文件系统上的文件使用,您需要明确保存它们 . )