首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何对我在谷歌的AutoML表中建立的模型进行批量预测--我在gCloud存储桶中拥有7000 (200GB+)的csv?

如何对我在谷歌的AutoML表中建立的模型进行批量预测--我在gCloud存储桶中拥有7000 (200GB+)的csv?
EN

Stack Overflow用户
提问于 2020-06-23 17:24:50
回答 1查看 656关注 0票数 0

我的问题似乎是,( CLI )看不到我在AutoML表产品下在这个项目中创建的模型,非常感谢您对此提供的任何帮助。

我试图使用7000+,因为我不能通过web接口一次提交一个web CSV(web接口仅限于一个输入文件)。我尝试过将CSV导入到BigQuery表中,但是在大约3M行之后导入失败。CSV有约7.3B行。

,我很想把它们全部导入BigQuery,把这个7.3B的数字降到我合理地认为是非零的结果,但我也不能把我所有的CSV都输入BigQuery .。

不管怎样,对于CLI来说:

我在这里阅读了gCloud的文档:https://cloud.google.com/ai-platform/prediction/docs/batch-predict,但这似乎指的是"AI平台“,而不是AutoML表产品。当我尝试使用此页面中列出的CLI指令时:

代码语言:javascript
复制
gcloud ai-platform jobs submit prediction myJob --model risk_vs_reward_v2 --input-paths "gs://portfolio_ml/test sets/v2 tests/*.csv" --output-path "gs://portfolio_ml/test set results/v2 results" --region us-central1 --data-format text

我得到:

代码语言:javascript
复制
Job [myJob] submitted successfully.
Your job is still active. You may view the status of your job with the command

  $ gcloud ai-platform jobs describe myJob

or continue streaming the logs with the command

  $ gcloud ai-platform jobs stream-logs myJob
ERROR: (gcloud.ai-platform.jobs.submit.prediction) Project [portfolio-ml] not found: Field: prediction_input.model_name Error: The model resource: "risk_vs_reward_v2" was not found. Please create the model resource first by using 'gcloud ai-platform models create risk_vs_reward_v2'.
- '@type': type.googleapis.com/google.rpc.BadRequest
  fieldViolations:
  - description: "The model resource: \"risk_vs_reward_v2\" was not found. Please\
      \ create the model resource first by using 'gcloud ai-platform models create\
      \ risk_vs_reward_v2'."
    field: prediction_input.model_name

当我检查gCloud是否可以看到我现在在AutoML表中的三种模型中的任何一种时:

代码语言:javascript
复制
gcloud ai-platform models list

带着0种型号回来了?

代码语言:javascript
复制
WARNING: Using endpoint [https://ml.googleapis.com/]
Listed 0 items.

我已经验证了我选择的正确项目有:

代码语言:javascript
复制
gcloud config set project portfolio-ml
EN

回答 1

Stack Overflow用户

发布于 2020-06-24 16:01:45

最后,我在云存储桶中使用AutoIT循环我的CSV,并在本地计算机上的Cloud命令中使用它们。我很幸运,我的输入CSV被编号了,但万一其他人的种子类似的东西:

(注意:有1M行的.csv每次从Cloud导入到BigQuery需要20多行。)

代码语言:javascript
复制
#include <MsgBoxConstants.au3>

; press ESC to stop the script in case something goes crazy and you can't click the AutoIT window
HotKeySet("^{ESC}", "Terminate") ; press ESC to stop script
Func Terminate()
   Exit
EndFunc

local $fileStart = 1
local $fileEnd = 1000
local $loadCommand
local $i = $fileStart

local $startTime = TimerInit()
local $avgprocTime = 0
local $remainingTime = 0

while $i <= $fileEnd

   ; see 'bg load' documentation to customize this for your BigQuery table 
   $loadCommand = 'cmd.exe /c bq load --autodetect --noreplace v2.test_criteria "gs://project_ml/test sets/v2 tests/test sets/testset-' & $i & '.csv'
   RunWait($loadCommand,"",@SW_HIDE)

   ; This section is optional, but helpful. If you don't use it, monitor load progress on the BigQuery page or change the @SW_HIDE flag on the RunWait command above so you can see the cmd window and the bg loading status text it shows
   $avgprocTime = TimerDiff($startTime)/($i-$fileStart+1)
   $remainingTime = ($fileEnd-$i)*$avgProcTime
   ConsoleWrite('Loaded file ' & $i & ' of ' & $fileEnd & '. ' & Round((TimerDiff($startTime)/1000)/60,1) & 'm elapsed, ' & Round($remainingTime/1000/60,1) & 'm remaining, ' & Round($avgProcTime/1000,1) & 's per file average.' & @LF)

   ;this is not optional ;)
   $i = $i + 1

WEnd
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62540423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档