Skip to content

Problem with model2json #16

Open
Open
@mishra-avinash

Description

@mishra-avinash

As you provided a python script. ./tool/model2json, to convert model to json file. When i am running this script with my model i am getting error:

TypeError: write() argument must be str, not bytes

Getting this error make sense because, how can you write bytes to a file that is opened in string mode. At line
model = base64.b64encode(bytes(open(sys.argv[3], 'rb').read()))

You are reading it in bytes but in line

with open(sys.argv1, 'w') as fo:

you are opening file in string mode and in line

fo.write(model)

You are writing bytes to string.
May be i am missing something, help me out with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions