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 occurred when msgpack loads lmdb #32

Closed
youcaiSUN opened this issue Feb 5, 2021 · 2 comments
Closed

Error occurred when msgpack loads lmdb #32

youcaiSUN opened this issue Feb 5, 2021 · 2 comments

Comments

@youcaiSUN
Copy link

Hi tengda,

When I test lmdb_dataset.py using your provided lmdb, I got the following error:
Loading LMDB from */UCF101/ucf101_rgb_lmdb/ucf101_frame.lmdb, split:1 Frame Dataset from "*/Code/CoCLR/dataset/../process_data/data/ucf101" has #class 101 filter out too short videos ... Traceback (most recent call last): File "*/Code/CoCLR/dataset/lmdb_dataset.py", line 999, in <module> x = dataset[0] File "*/Code/CoCLR/dataset/lmdb_dataset.py", line 146, in __getitem__ raw = msgpack.loads(txn.get(self.get_video_id[vname].encode('ascii'))) File "msgpack/_unpacker.pyx", line 195, in msgpack._cmsgpack.unpackb UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

The test script is:
if __name__ == "__main__": dataset = UCF101LMDB_2CLIP(db_path=os.path.join(lmdb_root, 'UCF101/ucf101_rgb_lmdb/ucf101_frame.lmdb')) x = dataset[0] print(x)

However, when I use my custom lmdb, there is no error occurred.
The msgpack verison I used is 1.0.1.
Could you help me to figure it out? Thanks!

@TengdaHan
Copy link
Owner

The package "msgpack" recently updated. I created the lmdb file using msgpack==0.6.2.

To load older version of lmdb with the new msgpack (e.g. 1.0.0+), using raw=True like msgpack.loads(txn.get(self.get_video_id[vname].encode('ascii')), raw=True) should work.
Source link: https://pypi.org/project/msgpack/#description

Let me know if it doesn't work.

@youcaiSUN
Copy link
Author

It works! Thanks for your promptly reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants