Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
6d4a77c7
Commit
6d4a77c7
authored
Apr 22, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MaskRCNN] make config serialize correctly
parent
c52c8cc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
examples/FasterRCNN/config.py
examples/FasterRCNN/config.py
+3
-0
tensorpack/utils/serialize.py
tensorpack/utils/serialize.py
+19
-1
No files found.
examples/FasterRCNN/config.py
View file @
6d4a77c7
...
...
@@ -20,6 +20,9 @@ class AttrDict():
def
__getattr__
(
self
,
name
):
if
self
.
_freezed
:
raise
AttributeError
(
name
)
if
name
.
startswith
(
'_'
):
# Do not mess with internals. Otherwise copy/pickle will fail
raise
AttributeError
(
name
)
ret
=
AttrDict
()
setattr
(
self
,
name
,
ret
)
return
ret
...
...
tensorpack/utils/serialize.py
View file @
6d4a77c7
...
...
@@ -13,7 +13,7 @@ from .develop import create_dummy_func
msgpack_numpy
.
patch
()
assert
msgpack
.
version
>=
(
0
,
5
,
2
)
__all__
=
[
'loads'
,
'dumps'
]
__all__
=
[
'loads'
,
'dumps'
,
'NonPicklableWrapper'
]
MAX_MSGPACK_LEN
=
1000000000
...
...
@@ -81,3 +81,21 @@ if os.environ.get('TENSORPACK_SERIALIZE', 'msgpack') == 'pyarrow':
else
:
loads
=
loads_msgpack
dumps
=
dumps_msgpack
class
NonPicklableWrapper
(
object
):
"""
TODO
https://github.com/joblib/joblib/blob/master/joblib/externals/loky/cloudpickle_wrapper.py
"""
def
__init__
(
self
,
obj
):
self
.
_obj
=
obj
def
__reduce__
(
self
):
import
dill
s
=
dill
.
dumps
(
self
.
_obj
)
return
dill
.
loads
,
(
s
,
)
def
__call__
(
self
,
*
args
,
**
kwargs
):
return
self
.
_obj
(
*
args
,
**
kwargs
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment