Pickling issues
See original GitHub issueHi, I have found a problem in pickling and unpickling the trees. After following through the original streaming example I tried pickling and unpickling a single tree, but the results are not same.
t = forest[0]
with open("a.pkl", "wb") as f:
pickle.dump(t.to_dict(), f)
t2 = rrcf.RCTree()
with open("a.pkl", "rb") as f:
t2.load_dict(pickle.load(f))
len(t.leaves)
# 257
len(t2.leaves)
# 238
I thought the issue is while calling pickle.dump
as the tree dict is nested, but the documentation says it’ll raise RecursionError
if such an object is encountered. So I think the issue could be with the to_dict
or load_dict
functions. I used both pickle
and dill
to test this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Troubleshooting common problems with home canned pickles
If you experience problems with hollow pickles, the most common cause is too much time between gathering and pickling. · Another cause is...
Read more >Common Pickle Problems | Home & Garden Information Center
Hollow pickles · Faulty growth of cucumber. None. During washing, hollow cucumbers usually float. Remove and use for relish. ; Shriveled pickles ......
Read more >Causes and Possible Solutions for Problems with Pickled Foods
Shriveled Pickles, 1. Placing cucumbers in too strong brine, too heavy syrup, or too strong vinegar. 1. Follow a reliable recipe. Use amounts...
Read more >COMMON PICKLE PROBLEMS - UC ANR
Remove scum as often as needed. Dark or discolored pickles (if brass, copper or zinc utensils were used do not use the pickles)...
Read more >Fermented Pickle Problems: Causes and Possible Solutions
Fermented Pickle Problems: Causes and Possible Solutions ; 3. Insufficient amount of brine. 3. Keep cucumbers immersed in the brine. ; 4. Pickles...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Greetings, this should now be addressed in #74
I’ve confirmed that this is an issue related to duplicate points. Moreover, it only seems to be a problem with the leaves dict–the tree structure itself appears to be ok.
The problem is on lines 816-817 of rrcf.py.
to_dict
may need to be rewritten to keep track of all the original indices for a given duplicated point.