cloudml icon indicating copy to clipboard operation
cloudml copied to clipboard

keras example mnist_mlp.R with cloudml

Open philipus opened this issue 5 years ago • 2 comments

I have got problems (see below) by applying mnist_mlp.R (https://github.com/rstudio/keras/blob/master/vignettes/examples/mnist_mlp.R) using cloudml_train on google cloud platform.

Any Idea what I can do. On my computer the code (mnist_mlp.R) works fine.

R commands:

library(cloudml) cloudml_train("mnist_mlp.R", config = "config.yml")

config.yml:

trainingInput: scaleTier: BASIC runtimeVersion: "2.1" pythonVersion: "3.7"

error message in logs of the google cloud platform:

"Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.local/lib/python3.7/site-packages/cloudml-model/cloudml/deploy.py", line 40, in sys.stdout.write(line) TypeError: write() argument must be str, not bytes "

philipus avatar May 12 '20 19:05 philipus

This issue is resolved in pull request #207. Briefly, this originates from different coding between the default Python 2.7 and 3.X versions and you need to change decoding to "UTF-8" in the deploy.py file to make it work.

pzet avatar May 13 '20 05:05 pzet

Thank you, that worked out for me!

philipus avatar May 13 '20 08:05 philipus