jmccormac / pySceneNetRGBD

Scripts showing how to work with the SceneNetRGBD dataset
GNU General Public License v3.0
178 stars 46 forks source link

TypeError: expected bytes, str found #9

Closed nrupatunga closed 6 years ago

nrupatunga commented 6 years ago

Error

(py35) root:pySceneNetRGBD# python read_protobuf.py

Traceback (most recent call last):
  File "read_protobuf.py", line 1, in <module>
    import scenenet_pb2 as sn
  File "/media/nrupatunga/data/datasets/SceneNet/pySceneNetRGBD/scenenet_pb2.py", line 16, in <module>
    serialized_pb='\n\x0escenenet.proto\x12\x08scenenet\"\xa6\x01\n\x0bSceneLayout\x12\x35\n\x0blayout_type\x18\x01 \x01(\x0e\x32 .scenenet.SceneLayout.LayoutType\x12\r\n\x05model\x18\x02 \x01(\t\"Q\n\nLayoutType\x12\x0c\n\x08\x42\x41THROOM\x10\x01\x12\x0b\n\x07\x42\x45\x44ROOM\x10\x02\x12\x0b\n\x07KITCHEN\x10\x03\x12\x0f\n\x0bLIVING_ROOM\x10\x04\x12\n\n\x06OFFICE\x10\x05\"\x87\x02\n\tLightInfo\x12\x31\n\nlight_type\x18\x01 \x01(\x0e\x32\x1d.scenenet.LightInfo.LightType\x12%\n\x0clight_output\x18\x02 \x01(\x0b\x32\x0f.scenenet.Power\x12$\n\x08position\x18\x03 \x01(\x0b\x32\x12.scenenet.Position\x12\x0e\n\x06radius\x18\x04 \x01(\x02\x12\x1e\n\x02v1\x18\x05 \x01(\x0b\x32\x12.scenenet.Position\x12\x1e\n\x02v2\x18\x06 \x01(\x0b\x32\x12.scenenet.Position\"*\n\tLightType\x12\n\n\x06SPHERE\x10\x01\x12\x11\n\rPARALLELOGRAM\x10\x02\"\xb0\x03\n\x10RandomObjectInfo\x12\x15\n\rshapenet_hash\x18\x01 \x01(\t\x12\x15\n\rheight_meters\x18\x02 \x01(\x02\x12>\n\x0bobject_pose\x18\x03 \x01(\x0b\x32).scenenet.RandomObjectInfo.Transformation\x1a\xad\x02\n\x0eTransformation\x12\x15\n\rtranslation_x\x18\x01 \x01(\x02\x12\x15\n\rtranslation_y\x18\x02 \x01(\x02\x12\x15\n\rtranslation_z\x18\x03 \x01(\x02\x12\x16\n\x0erotation_mat11\x18\x04 \x01(\x02\x12\x16\n\x0erotation_mat12\x18\x05 \x01(\x02\x12\x16\n\x0erotation_mat13\x18\x06 \x01(\x02\x12\x16\n\x0erotation_mat21\x18\x07 \x01(\x02\x12\x16\n\x0erotation_mat22\x18\x08 \x01(\x02\x12\x16\n\x0erotation_mat23\x18\t \x01(\x02\x12\x16\n\x0erotation_mat31\x18\n \x01(\x02\x12\x16\n\x0erotation_mat32\x18\x0b \x01(\x02\x12\x16\n\x0erotation_mat33\x18\x0c \x01(\x02\"\xc0\x02\n\x08Instance\x12\x13\n\x0binstance_id\x18\x01 \x01(\x05\x12\x1b\n\x13semantic_wordnet_id\x18\x02 \x01(\t\x12\x18\n\x10semantic_english\x18\x03 \x01(\t\x12\x36\n\rinstance_type\x18\x04 \x01(\x0e\x32\x1f.scenenet.Instance.InstanceType\x12\'\n\nlight_info\x18\x05 \x01(\x0b\x32\x13.scenenet.LightInfo\x12/\n\x0bobject_info\x18\x06 \x01(\x0b\x32\x1a.scenenet.RandomObjectInfo\"V\n\x0cInstanceType\x12\x0e\n\nBACKGROUND\x10\x01\x12\x11\n\rLAYOUT_OBJECT\x10\x02\x12\x10\n\x0cLIGHT_OBJECT\x10\x03\x12\x11\n\rRANDOM_OBJECT\x10\x04\"(\n\x05Power\x12\t\n\x01r\x18\x01 \x01(\x02\x12\t\n\x01g\x18\x02 \x01(\x02\x12\t\n\x01\x62\x18\x03 \x01(\x02\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"a\n\x04Pose\x12\"\n\x06\x63\x61mera\x18\x01 \x01(\x0b\x32\x12.scenenet.Position\x12\"\n\x06lookat\x18\x02 \x01(\x0b\x32\x12.scenenet.Position\x12\x11\n\ttimestamp\x18\x03 \x01(\x02\"f\n\x04View\x12\x11\n\tframe_num\x18\x01 \x01(\x05\x12$\n\x0cshutter_open\x18\x02 \x01(\x0b\x32\x0e.scenenet.Pose\x12%\n\rshutter_close\x18\x03 \x01(\x0b\x32\x0e.scenenet.Pose\"\x8e\x01\n\nTrajectory\x12%\n\x06layout\x18\x01 \x01(\x0b\x32\x15.scenenet.SceneLayout\x12%\n\tinstances\x18\x02 \x03(\x0b\x32\x12.scenenet.Instance\x12\x1d\n\x05views\x18\x03 \x03(\x0b\x32\x0e.scenenet.View\x12\x13\n\x0brender_path\x18\x04 \x01(\t\":\n\x0cTrajectories\x12*\n\x0ctrajectories\x18\x01 \x03(\x0b\x32\x14.scenenet.Trajectory')
  File "/home/nrupatunga/Work-2017/Softwares/anaconda2/envs/py35/lib/python3.5/site-packages/google/protobuf/descriptor.py", line 824, in __new__
    return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: expected bytes, str found

Protoc version

(py35) root:pySceneNetRGBD# protoc --version
libprotoc 2.5.0

@ankurhanda @jmccormac can you help ?

nrupatunga commented 6 years ago

switching to python 2 worked. I guess it has to do with new feature of Python 3 for much cleaner separation between text and binary data

rubeea commented 4 years ago

The project page says that it has been tested with python 3.6 then why isn't it working?

"MarcBS/keras has been tested with: Python 2.7 and Python 3.6 and with the Theano and Tensorflow backends."