tensorflow / tensorflow/models
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 67: invalid continuation byte
@pkulzc is already working on this.
Since Oct 6, 2020.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am using the latest TensorFlow Model Garden release and TensorFlow 2.
- I am reporting the issue to the correct repository. (Model Garden official or research directory)
- I checked to make sure that this issue has not already been filed.
1. The entire URL of the file you are using
https://github.com/tensorflow/models/tree/master/research/...
2. Describe the bug
When I'm trying to run Intro to Object Detection Colab from https://github.com/tensorflow/models/blob/master/research/object_detection/colab_tutorials/inference_tf2_colab.ipynb im getting this error:
2020-10-06 12:45:05.546503: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
D:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/Lib/site-packages/tensorflow/models/research/object_detection/configs/tf2/centernet_hourglass104_512x512_kpts_coco17_tpu-32.config
2020-10-06 12:45:07.308425: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2020-10-06 12:45:07.329827: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1660 Ti computeCapability: 7.5
coreClock: 1.59GHz coreCount: 24 deviceMemorySize: 6.00GiB deviceMemoryBandwidth: 268.26GiB/s
2020-10-06 12:45:07.329967: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-10-06 12:45:07.333718: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll
2020-10-06 12:45:07.337033: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2020-10-06 12:45:07.338007: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2020-10-06 12:45:07.341680: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2020-10-06 12:45:07.343603: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2020-10-06 12:45:07.351476: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2020-10-06 12:45:07.351664: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
2020-10-06 12:45:07.351983: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-10-06 12:45:07.358623: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2004e16ee00 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-10-06 12:45:07.358707: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-10-06 12:45:07.359356: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 1660 Ti computeCapability: 7.5
coreClock: 1.59GHz coreCount: 24 deviceMemorySize: 6.00GiB deviceMemoryBandwidth: 268.26GiB/s
2020-10-06 12:45:07.359592: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
2020-10-06 12:45:07.359958: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cublas64_10.dll
2020-10-06 12:45:07.360345: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2020-10-06 12:45:07.360655: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2020-10-06 12:45:07.360700: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2020-10-06 12:45:07.361085: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusparse64_10.dll
2020-10-06 12:45:07.361400: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_7.dll
2020-10-06 12:45:07.361477: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1858] Adding visible gpu devices: 0
2020-10-06 12:45:07.859023: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-10-06 12:45:07.859104: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263] 0
2020-10-06 12:45:07.860109: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1276] 0: N
2020-10-06 12:45:07.860557: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1402] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4743 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5)
2020-10-06 12:45:07.864254: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x20078253a90 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-10-06 12:45:07.864339: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 1660 Ti, Compute Capability 7.5
Traceback (most recent call last):
File "D:\code\Diplom\Diplom.py", line 69, in
model_config=model_config, is_training=False)
File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\object_detection\builders\model_builder.py", line 1089, in build
add_summaries)
File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\object_detection\builders\model_builder.py", line 988, in _build_center_net_model
center_net_config.keypoint_label_map_path)
File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\object_detection\utils\label_map_util.py", line 156, in load_labelmap
label_map_string = fid.read(-1)
File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 116, in read
self._preread_check()
File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 79, in _preread_check
self.__name, 1024 * 512)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 67: invalid continuation byte
Tried both #9225 and https://github.com/TannerGilbert/Tensorflow-Object-Detection-API-train-custom-Mask-R-CNN-model/issues/3#issuecomment-696488627 still the same error.
Edit: putting actual path into label_map_path: "PATH_TO_BE_CONFIGURED/label_map.txt" string moves error position from 67 to 174.
3. Steps to reproduce
Steps to reproduce the behavior.
4. Expected behavior
A clear and concise description of what you expected to happen.
5. Additional context
Include any logs that would be helpful to diagnose the problem.
6. System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
- Mobile device name if the issue happens on a mobile device:
- TensorFlow installed from (source or binary): pip
- TensorFlow version (use command below): 2.3.1
- Python version: 3.7.8
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version:
- GPU model and memory: GTX 1660Ti 6Gb
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.