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

Problem .json #47

Open
jessiffmm opened this issue Jun 5, 2022 · 2 comments
Open

Problem .json #47

jessiffmm opened this issue Jun 5, 2022 · 2 comments

Comments

@jessiffmm
Copy link
Collaborator

There are problems training with the .json. I get the error:
File "/home/vanejessi/DeepLearningStudio/Formula1-FollowLine/tensorflow/PilotNet/utils/processing.py", line 19, in parse_json
array_annotations_v.append(float(v))
ValueError: could not convert string to float: '"7.0",\n "w": "0.044"\n '

The .json file is:
[
{
"image_name": "0.png",
"v": "7.0",
"w": "0.044"
},
{
"image_name": "1.png",
"v": "7.0",
"w": "0.022"
},
{
"image_name": "2.png",
"v": "7.0",
"w": "0.022"
},
{
"image_name": "3.png",
"v": "7.0",
"w": "0.022"
},
...
]

@sergiopaniego
Copy link
Member

Are you using the new opencv dataset?

If so, the code is something like this:

def parse_csv(csv_data):
    array = []
    linear_speeds = csv_data['v'].tolist()
    angular_speeds = csv_data['w'].tolist()
    for x, linear_speed in enumerate(linear_speeds):
        array.append((float(linear_speed), float(angular_speeds[x])))
    return array

...

array_annotations = pandas.read_csv(annotation_name_file)
array_annotations = parse_csv(array_annotations)

@jessiffmm
Copy link
Collaborator Author

Yes, I'm using the new opencv dataset.
Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants