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

gbk error. How can I solve it? #1669

Closed
Krasjet-Yu opened this issue Dec 11, 2020 · 7 comments
Closed

gbk error. How can I solve it? #1669

Krasjet-Yu opened this issue Dec 11, 2020 · 7 comments
Labels
bug Something isn't working Stale

Comments

@Krasjet-Yu
Copy link

Traceback (most recent call last):
File "train.py", line 504, in
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 70, in train
data_dict = yaml.load(f, Loader=yaml.FullLoader) # data dict
File "D:\Anaconda3\envs\pytorch-gpu\lib\site-packages\yaml_init_.py", line 112, in load
loader = Loader(stream)
File "D:\Anaconda3\envs\pytorch-gpu\lib\site-packages\yaml\loader.py", line 24, in init
Reader.init(self, stream)
File "D:\Anaconda3\envs\pytorch-gpu\lib\site-packages\yaml\reader.py", line 85, in init
self.determine_encoding()
File "D:\Anaconda3\envs\pytorch-gpu\lib\site-packages\yaml\reader.py", line 124, in determine_encoding
self.update_raw()
File "D:\Anaconda3\envs\pytorch-gpu\lib\site-packages\yaml\reader.py", line 178, in update_raw
data = self.stream.read(size)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 429: illegal multibyte sequence

@Krasjet-Yu Krasjet-Yu added the bug Something isn't working label Dec 11, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2020

Hello @zipYu, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@wudashuo
Copy link
Contributor

Looks like your yaml file is encoding with gbk, use utf-8 instead.
编程一定要注意编码格式,gbk和gb2312要避免使用,统一使用utf-8

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@helloworldbyqiqi
Copy link

I have the same problem, change to the source code format is also a problem.Have you solved the problem?

@glenn-jocher
Copy link
Member

@helloworldbyqiqi hello! Thank you for bringing up this issue. The error you are encountering seems to be related to the encoding format of your YAML file. It is recommended to use UTF-8 encoding instead of GBK or GB2312.

Fortunately, the YOLOv5 repository supports UTF-8 encoding, which is the default encoding for most programming languages and text editors. You can change the encoding format of your YAML file by saving it with UTF-8 encoding.

If you are still facing any issues after changing the encoding format, please provide more details about your problem, such as specific error messages or code snippets. This will help us in assisting you further.

@helloworldbyqiqi
Copy link

@glenn-jocher Thank you very much for your answer. My problem has been solved. As you said is the file encoding format problem, after the change of the problem the code can run normally!

@glenn-jocher
Copy link
Member

@helloworldbyqiqi you're welcome! I'm glad to hear that your issue has been resolved. If you have any further questions or need any assistance in the future, feel free to ask. The YOLOv5 community and the Ultralytics team are always here to help. Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

4 participants