Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FreeForestML
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CERN
fsauerbu
FreeForestML
Commits
3979bfca
Commit
3979bfca
authored
3 years ago
by
Ahmed Markhoos
Browse files
Options
Downloads
Patches
Plain Diff
Replacing cloudpickle with dill as a fix for pickling locked objects
parent
7a9a9b23
Branches
44-data-content-interface
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!68
dill replacement and keras fix
Pipeline
#12698
failed
3 years ago
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
freeforestml/helpers.py
+3
-3
3 additions, 3 deletions
freeforestml/helpers.py
freeforestml/variable.py
+1
-1
1 addition, 1 deletion
freeforestml/variable.py
requirements.txt
+1
-1
1 addition, 1 deletion
requirements.txt
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
6 additions
and
6 deletions
freeforestml/helpers.py
+
3
−
3
View file @
3979bfca
import
base64
import
cloudpickle
import
dill
def
python_to_str
(
obj
):
"""
Convert an arbitrary python object into a string and encode it in base64.
"""
obj_string
=
cloudpickle
.
dumps
(
obj
)
obj_string
=
dill
.
dumps
(
obj
)
obj_base64
=
base64
.
b64encode
(
obj_string
).
decode
()
return
obj_base64
...
...
@@ -16,5 +16,5 @@ def str_to_python(string):
Reverse of the python_to_str() function.
"""
obj_string
=
base64
.
b64decode
(
string
)
obj
=
cloudpickle
.
loads
(
obj_string
)
obj
=
dill
.
loads
(
obj_string
)
return
obj
This diff is collapsed.
Click to expand it.
freeforestml/variable.py
+
1
−
1
View file @
3979bfca
...
...
@@ -2,7 +2,7 @@ from abc import ABC, abstractmethod
import
base64
import
os
import
cloudpickle
import
dill
import
numpy
as
np
import
h5py
...
...
This diff is collapsed.
Click to expand it.
requirements.txt
+
1
−
1
View file @
3979bfca
cloudpickle
dill
h5py
numpy
matplotlib
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
3979bfca
...
...
@@ -12,7 +12,7 @@ from setuptools import setup
setup
(
name
=
'
freeforestml
'
,
version
=
'
0.0.0
'
,
# Also change in module
packages
=
[
"
freeforestml
"
,
"
freeforestml.tests
"
],
install_requires
=
[
"
cloudpickle
"
,
install_requires
=
[
"
dill
"
,
"
h5py
"
,
"
numpy
"
,
"
matplotlib
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment