如何在google-cloud-ml中设置pytorch

时间:2018-01-25 02:08:08

标签: pytorch google-cloud-ml

我尝试用google-cloud-ml中的from setuptools import find_packages from setuptools import setup REQUIRED_PACKAGES = ['http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl','torchvision'] setup( name='trainer', version='0.1', install_requires=REQUIRED_PACKAGES, packages=find_packages(), include_package_data=True, description='My keras trainer application package.' ) 代码投入工作。 所以我编写了“setup.py”文件。并添加选项“install_requires”

“setup.py”

{
 insertId:  "3m78xtf9czd0u"  
 jsonPayload: {
  created:  1516845879.49039   
  levelname:  "ERROR"   
  lineno:  829   
  message:  "Command '['pip', 'install', '--user', '--upgrade', '--force-reinstall', '--no-deps', u'trainer-0.1.tar.gz']' returned non-zero exit status 1"   
  pathname:  "/runcloudml.py"   
 }
 labels: {
  compute.googleapis.com/resource_id:  "6637909247101536087"   
  compute.googleapis.com/resource_name:  "cmle-training-master-5502b52646-0-ql9ds"   
  compute.googleapis.com/zone:  "us-central1-c"   
  ml.googleapis.com/job_id:  "run_ml_engine_pytorch_test_20180125_015752"   
  ml.googleapis.com/job_id/log_area:  "root"   
  ml.googleapis.com/task_name:  "master-replica-0"   
  ml.googleapis.com/trial_id:  ""   
 }
 logName:  "projects/exem-191100/logs/master-replica-0"  
 receiveTimestamp:  "2018-01-25T02:04:55.421517460Z"  
 resource: {
  labels: {…}   
  type:  "ml_job"   
 }
 severity:  "ERROR"  
 timestamp:  "2018-01-25T02:04:39.490387916Z"  
}

并将作业投入google-cloud-ml,但它不起作用

,错误消息

  Jack Tom Shansa Stack

=============================================== =====================

See detailed message here

那么如何在google cloud ml引擎中使用pytorch?

2 个答案:

答案 0 :(得分:2)

我找到了关于在 google-cloud-ml

中设置 PYTORCH 的解决方案

<强>第一 您必须获取有关pytorch的{​​{1}}文件并将其存储到Google存储分区。 并且您将获得存储桶链接的链接。

format: {'field': {$operator: ISODate(yyyy-MM-ddThh:mm:ss.msZ)}}

example: db.getCollection('yourCollection').find({'sampleField': {$lte: ISODate('2015-06-17T10:03:46.000Z')}})

- (IBAction)btnFaceBook:(id)sender { FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; [login setLoginBehavior:FBSDKLoginBehaviorBrowser]; [login logInWithReadPermissions:@[@"public_profile",@"email"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { if (error) { [[FBSDKLoginManager new]logOut]; } else if (result.isCancelled) { // Handle cancellations } else { if ([result.grantedPermissions containsObject:@"email"]) { [self getDataFromFB]; } } }]; } -(void)getDataFromFB { MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:true]; if ([FBSDKAccessToken currentAccessToken]) { [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:[NSDictionary dictionaryWithObject:@"political,picture.width(500).height(500),id,email,first_name,last_name,gender,name" forKey:@"fields"]] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { if (!error && [result count] != 0) { [hud hideAnimated:true]; NSLog(@"%@", result); } else { [hud hideAnimated:true]; [self displayAlertMesage:@"Some error has been occure." title:@"Oops!"]; } }]; } } 文件取决于您的python版本或cuda版本....

<强>第二 你编写命令行和setup.py,因为你必须设置google-cloud-ml设置。 相关链接是submit_job_to_ml-engine 您编写.whl文件来描述您的设置。 相关链接是write_setup.py_file

这是我的命令代码和setup.py文件

=============================================== ======================  的&#34;命令&#34;

gs://bucketname/directory/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl

=============================================== ====================== &#34; setup.py&#34;

.whl

=============================================== ======================

<强>第三 如果你有经验提交工作到ml引擎。 你可能知道提交ml-engine的文件结构 packaging_training_model。 你必须按照上面的链接,知道如何打包文件。

答案 1 :(得分:0)

实际的错误信息有点埋没,但就是这样:

  

'install_requires'必须是包含的字符串或字符串列表   有效的项目/版本要求说明者;要求无效,   解析错误在“':// downl'”

要使用非PyPI托管的软件包,您需要使用I want to display the hyperlinks to make it as generic single hyperlink with iteration. I have a string array in constants with key ,value,param property and want to read those and display them (请参阅this文档)。这样的事情应该有效:

Parser Error: **Got interpolation ({{}}) where expression was expected at column 15 in [onlinkselected({{param}})]** in ng:///AppModule/OtherAccountInformationComponent.html@6:87 ("p-6"></div>

        <a id="{{otheraccountinfolink.key}}_lnk_lbl" href="{{otheraccountinfolink.value}}" [ERROR ->](click)="onlinkselected({{param}})">{{otheraccountinfolink.value}}</a>
      </div>
    </div>
    "): ng:///AppModule/OtherAccountInformationComponent.html@6:87
    Parser Error: Unexpected token {, expected identifier, keyword, or string at column 17 in [onlinkselected({{param}})] in ng:///AppModule/OtherAccountInformationComponent.html@6:87 ("p-6"></div>