Open niatdlut opened 4 years ago
I met the same problem. and also, next lines shows "ValueError: could not convert string to float: '(1169.62109375, 0.0, 646.2950439453125, 0.0, 0.0, 1167.1051025390625, 489.9270324707031, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0)'
@niatdlut I think you are using python 3 and this script was done for python 2. The module struct which is the one giving you problems has changed the interface, thus it does not return the values that it was supposed to. If you want to run it in python3 you will have to update the calls to struct or the processing of the returned data.
@jmfacil could you pose the python3 version code ?
The reason is that the "join" function can only work with str type, not byte type, in python3. The byte type is treated as str type in python2, therefore it works in python2. In python 3, we can use "+" to reduce the tuple of bytes instead of "join".
@ajithvallabai to run with py3, you can simply replace ''.join with b''.join
This works for me! Thank you very much!
@ajithvallabai to run with py3, you can simply replace ''.join with b''.join
I can not understand the solution: simply replay ''.join with b''.join, can you show me the py3 version of 'self.sensor_name = ''.join(struct.unpack('c'*strlen, f.read(strlen)))'
self.color_data = b''.join(struct.unpack('c'*self.color_size_bytes, file_handle.read(self.color_size_bytes))) MemoryError
Replace SensorData with this: https://github.com/pengsongyou/openscene/blob/main/scripts/preprocess/scannet_sensordata.py
I want to export color images and depth images. I use reader.py at 'ScanNet/SensReader/python/' with: python reader.py --filename raw_data_ScanNet/scene0000_01/scene0000_01.sens --output_path datasets_ScanNet/scene0000_01 --export_depth_images --export_color_images But I receive the error when use the SensorData.py " line 57, in load self.sensor_name = ''.join(struct.unpack('c'*strlen, f.read(strlen))) TypeError: sequence item 0: expected str instance, bytes found " my python version is python3.7. could you tell me how to fix this problem?