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

Model Won't Train with Local Agent - Charmap Error #160

Closed
1 task done
Forfy-code opened this issue Feb 16, 2023 · 6 comments
Closed
1 task done

Model Won't Train with Local Agent - Charmap Error #160

Forfy-code opened this issue Feb 16, 2023 · 6 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@Forfy-code
Copy link

Search before asking

  • I have searched the HUB issues and found no similar bug report.

HUB Component

No response

Bug

I want train my model with my own agent and and I have received the following error:

Ultralytics: 'charmap' codec can't decode byte 0x90 in position 102: character maps to

ClearML Monitor: Could not detect iteration reporting, falling back to iterations as seconds-from-start

Could you help me? Thanks

Environment

Ultralytics HUB Version
v0.1.17-beta.30
Client User Agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0
Operating System
Win32
Browser Window Size
1920 x 955
Server Timestamp
1676539696

Minimal Reproducible Example

No response

Additional

No response

@Forfy-code Forfy-code added the bug Something isn't working label Feb 16, 2023
@kalenmike
Copy link
Member

@Forfy-code Thanks for raising an issue. This was reported once before, but we have been unable to replicate the issue. Originally it was reported by a user running Windows 10. What operating system are you attempting to train from? And do you have the same problem with ClearML disabled?

@kalenmike kalenmike changed the title Charmap Model Won't Train with Local Agent - Charmap Error Feb 17, 2023
@kalenmike kalenmike self-assigned this Feb 17, 2023
@Forfy-code
Copy link
Author

@Forfy-code Thanks for raising an issue. This was reported once before, but we have been unable to replicate the issue. Originally it was reported by a user running Windows 10. What operating system are you attempting to train from? And do you have the same problem with ClearML disabled?

I'm running in Windows 10. Before I didn't have ClearML activated and it also gave error that I activated ClearML.

@Forfy-code
Copy link
Author

Forfy-code commented Feb 21, 2023

I think that the error comes from the yaml file that reads it wrong, because testing on these files I have found the same error:

before I had a program to read yamls like this:
import yaml
from yaml.loader import SafeLoader

with open('data.yaml') as f:
data = yaml.load(f, Loader=SafeLoader)
print(data)

And I got this error: 'charmap' codec can't decode byte 0x90 in position 295: character maps to .

Now I have this program and it reads it without problems:
import codecs
import yaml

with codecs.open('file.yaml', 'r', encoding='utf-8') as f:
data = yaml.load(f, Loader=yaml.SafeLoader)

If you could fix it, that would be great.

@Forfy-code
Copy link
Author

Forfy-code commented Feb 21, 2023

To explore this, I used the YAML of this dataset: https://github.com/ultralytics/hub/blob/master/coco6.zip

@github-actions
Copy link

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale label Mar 24, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
@UltralyticsAssistant
Copy link
Member

@Forfy-code i appreciate you providing additional context on the issue you are encountering. The information you've provided suggests that there may be an encoding problem when the YAML file is read on a Windows system. It appears that specifying an encoding of 'utf-8' when opening the YAML file has resolved the issue in your standalone script.

The error you're encountering with 'charmap' codec can indeed be triggered by attempting to read a file that contains characters not supported by your system's default character map. By default, Windows often uses character encodings that are more limited than 'utf-8', which can lead to such errors when dealing with files that contain certain Unicode characters.

Considering that you've encountered this with the Ultralytics HUB, we would need to investigate this further to determine why the encoding issue arises during the file reading process within our platform. This feedback will be useful for identifying and correcting the issue in future updates of the HUB software.

In the meantime, I would recommend ensuring that any YAML files you intend to use with Ultralytics HUB are saved with utf-8 encoding to prevent such issues. In case you're using any custom scripts, please ensure they are opening the files with the correct encoding set as you've done in your current working script.

If you could create an issue in our GitHub repository with the details of the error, environment and the workaround that worked for you, it would be greatly appreciated. Our development team will then be able to address this in more detail, and other users experiencing similar issues would benefit from the discussion.

For your reference, the Ultralytics HUB documentation available can be referred to for further guidance on best practices and usage. Thank you once again for bringing this to our attention.

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

3 participants