Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keras example mnist_mlp.R with cloudml #209

Open
philipus opened this issue May 12, 2020 · 2 comments
Open

keras example mnist_mlp.R with cloudml #209

philipus opened this issue May 12, 2020 · 2 comments

Comments

@philipus
Copy link

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
"

@pzet
Copy link

pzet commented May 13, 2020

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.

@philipus
Copy link
Author

Thank you, that worked out for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants