Comments (8)
Hmm, could you give me example code for repro? Actually sym_sealed
is defined in pyglove.core.symbolic.Symbolic
.
from pyglove.
Unfortunately, I can not easily reproduce it, that I can say is that the pyglove Object that involved is a pretty simple one such as
class AA(pg.Object):
tokenizer: Annotated[AbstractTokenizer, "Tokenizer"] = get_tokenizer(
"..."
)
max_num: Annotated[
int,
"The maximum number of tokens for prefix, where -1 means infinity.",
] = -1
The error occurs in some weird spark runs and can not easily be debugged. However, replacing pg.Object with Object works fine on the codes.
from pyglove.
I'm not sure whether it conflicts with some underling serialization / deserialization functions used in other libraries.
from pyglove.
Not sure. Can you share longer callstacks?
from pyglove.
Seems not more callstacks, it was like:
23/07/21 16:41:04 WARN TaskSetManager: Lost task 0.0 in stage 9.0 (TID 165) (216.153.61.120 executor 14): org.apache.spark.api.python.PythonException: Traceback (most recent call last):
File "~/.local/lib/python3.9/site-packages/pyglove/core/symbolic/dict.py", line 628, in __setitem__
if base.treats_as_sealed(self):
...
```
from pyglove.
I found a minimum reproducible example:
import pickle
from typing import Annotated, Dict
import pyglove as pg
class A(pg.Object):
x: Annotated[Dict, "."] = dict()
y: Annotated[str, "."] = ".."
# Define a simple dictionary
# data = A(x={1:1})
data = A()
# Serialization
serialized_data = pickle.dumps(data)
print(f"Serialized data: {serialized_data}")
# Deserialization
deserialized_data = pickle.loads(serialized_data)
print(f"Deserialized data: {deserialized_data}")
from pyglove.
Great, it turns out pickle
does not work well with pg.Symbolic
types previously.
Fixed by #194.
from pyglove.
Nice, thanks for your supports!
from pyglove.
Related Issues (20)
- Defining symbolic attributes not in initialization HOT 2
- Having tied parameters? HOT 5
- pg.sample returns same function from functor HOT 1
- PyTorch ResNet Example in Table 1 of paper HOT 1
- Breadth-first search for pg.iter HOT 1
- Missing type error in the error log HOT 2
- How to use load and save for non-pyglove types HOT 5
- pg.diff between two identical objects HOT 5
- Release 0.4.1 HOT 2
- Dict is not accepting int as key. HOT 1
- Can we disable __init__ for the users? HOT 2
- Question on Type Annotation and Docstring HOT 5
- Untyped Check HOT 2
- v0.11 tag seems a typo :) HOT 1
- Incompatible Type Annotation Literal
- More documentation on use with OSS Vizier
- Backward compatibility for Python < 3.9.
- Use `pg.typing` as type annotations HOT 1
- Clarification on Efficiency HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyglove.