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

Error when using model$export() #106

Closed
Cdk29 opened this issue Jan 7, 2021 · 3 comments
Closed

Error when using model$export() #106

Cdk29 opened this issue Jan 7, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Cdk29
Copy link
Contributor

Cdk29 commented Jan 7, 2021

When training a model like in this notebook or here (md doc to got the session infos).

I got the following error from python :


Quitting from lines 106-107 (Bug_method_export.Rmd) 
Error in py_call_impl(callable, dots$args, dots$keywords) : 
  AttributeError: Can't pickle local object 'make_python_function.<locals>.python_function'

Detailed traceback: 
  File "/home/erolland/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/fastai/learner.py", line 542, in export
    torch.save(self, self.path/fname, pickle_protocol=pickle_protocol)
  File "/home/erolland/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/torch/serialization.py", line 372, in save
    _save(obj, opened_zipfile, pickle_module, pickle_protocol)
  File "/home/erolland/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/torch/serialization.py", line 476, in _save
    pickler.dump(obj)
Calls: <Anonymous> ... withVisible -> eval -> eval -> <Anonymous> -> py_call_impl
Exécution arrêtée

When I am running :

learnR$export(fname = export.pkl)

The error message came from the first notebook. The second md document provide the session infos().

@turgut090 turgut090 added the bug Something isn't working label Jan 8, 2021
@turgut090
Copy link
Member

Thanks so much for this issue. I fixed that. However, could you write the metric like this: accuracy() not accuracy and see if this will work for you.

@Cdk29
Copy link
Contributor Author

Cdk29 commented Jan 17, 2021

Sorry for the delay, I go into this as soon as I can.

@Cdk29
Copy link
Contributor Author

Cdk29 commented Jan 20, 2021

@henry090 I run it with accuracy() and it worked perfectly.

@Cdk29 Cdk29 closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants