wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
6.92k stars 1.77k forks source link

NameError: name 'false' is not defined when I try to generate .wts #1420

Closed SJavad closed 7 months ago

SJavad commented 9 months ago

I try to convert yolov5.pt model to wts format and when I enter the python gen_wts.py -w best.pt -o best.wts I get this error:

{"payload":{"allShortcutsEnabled":false,"fileTree":{"yolov5":{"items":[{"name":"plugin","path":"yolov5/plugin","contentType":"directory"},{"name":"src","path":"yolov5/src","contentType":"directory"},{"name":"CMakeLists.txt","path":"yolov5/CMakeLists.txt","contentType":"file"},{"name":"README.md","path":"yolov5/README.md","contentType":"file"},{"name":"gen_wts.py","path":"yolov5/gen_wts.py","contentType":"file"},{"name":"images","path":"yolov5/images","contentType":"symlink_directory"},{"name":"yolov5_cls.cpp","path":"yolov5/yolov5_cls.cpp","contentType":"file"},{"name":"yolov5_cls_trt.py","path":"yolov5/yolov5_cls_trt.py","contentType":"file"},{"name":"yolov5_det.cpp","path":"yolov5/yolov5_det.cpp","contentType":"file"},{"name":"yolov5_det_cuda_python.py","path":"yolov5/yolov5_det_cuda_python.py","contentType":"file"},{"name":"yolov5_det_trt.py","path":"yolov5/yolov5_det_trt.py","contentType":"file"},{"name":"yolov5_seg.cpp","path":"yolov5/yolov5_seg.cpp","contentType":"file"},{"name":"yolov5_seg_trt.py","path":"yolov5/yolov5_seg_trt.py","contentType":"file"}],"totalCount":13},"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"alexnet","path":"alexnet","contentType":"directory"},{"name":"arcface","path":"arcface","contentType":"directory"},{"name":"centernet","path":"centernet","contentType":"directory"},{"name":"crnn","path":"crnn","contentType":"directory"},{"name":"dbnet","path":"dbnet","contentType":"directory"},{"name":"densenet","path":"densenet","contentType":"directory"},{"name":"detr","path":"detr","contentType":"directory"},{"name":"docker","path":"docker","contentType":"directory"},{"name":"efficientnet","path":"efficientnet","contentType":"directory"},{"name":"googlenet","path":"googlenet","contentType":"directory"},{"name":"hrnet","path":"hrnet","contentType":"directory"},{"name":"ibnnet","path":"ibnnet","contentType":"directory"},{"name":"inception","path":"inception","contentType":"directory"},{"name":"lenet","path":"lenet","contentType":"directory"},{"name":"lprnet","path":"lprnet","contentType":"directory"},{"name":"mlp","path":"mlp","contentType":"directory"},{"name":"mnasnet","path":"mnasnet","contentType":"directory"},{"name":"mobilenet","path":"mobilenet","contentType":"directory"},{"name":"psenet","path":"psenet","contentType":"directory"},{"name":"rcnn","path":"rcnn","contentType":"directory"},{"name":"real-esrgan","path":"real-esrgan","contentType":"directory"},{"name":"refinedet","path":"refinedet","contentType":"directory"},{"name":"repvgg","path":"repvgg","contentType":"directory"},{"name":"resnet","path":"resnet","contentType":"directory"},{"name":"retinaface","path":"retinaface","contentType":"directory"},{"name":"retinafaceAntiCov","path":"retinafaceAntiCov","contentType":"directory"},{"name":"scaled-yolov4","path":"scaled-yolov4","contentType":"directory"},{"name":"senet","path":"senet","contentType":"directory"},{"name":"shufflenetv2","path":"shufflenetv2","contentType":"directory"},{"name":"squeezenet","path":"squeezenet","contentType":"directory"},{"name":"superpoint","path":"superpoint","contentType":"directory"},{"name":"swin-transformer","path":"swin-transformer","contentType":"directory"},{"name":"tsm","path":"tsm","contentType":"directory"},{"name":"tutorials","path":"tutorials","contentType":"directory"},{"name":"ufld","path":"ufld","contentType":"directory"},{"name":"unet","path":"unet","contentType":"directory"},{"name":"vgg","path":"vgg","contentType":"directory"},{"name":"yolop","path":"yolop","contentType":"directory"},{"name":"yolov3-spp","path":"yolov3-spp","contentType":"directory"},{"name":"yolov3-tiny","path":"yolov3-tiny","contentType":"directory"},{"name":"yolov3","path":"yolov3","contentType":"directory"},{"name":"yolov4","path":"yolov4","contentType":"directory"},{"name":"yolov5","path":"yolov5","contentType":"directory"},{"name":"yolov7","path":"yolov7","contentType":"directory"},{"name":"yolov8","path":"yolov8","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"}],"totalCount":49}},"fileTreeProcessingTime":8.282295,"foldersToFetch":[],"reducedMotionEnabled":null,"repo":{"id":223904726,"defaultBranch":"master","name":"tensorrtx","ownerLogin":"wang-xinyu","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2019-11-25T09:01:36.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/15235574?v=4","public":true,"private":false,"isOrgOwned":false},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1698999982.0","canEdit":false,"refType":"branch","currentOid":"2df7dd7f9100fc04262e2a53fc53666eed28f84c"},"path":"yolov5/gen_wts.py","currentUser":null,"blob":{"rawLines":["import sys","import argparse","import os","import struct","import torch","from utils.torch_utils import select_device","","","def parse_args():","    parser = argparse.ArgumentParser(description='Convert .pt file to .wts')","    parser.add_argument('-w', '--weights', required=True,","                        help='Input weights (.pt) file path (required)')","    parser.add_argument(","        '-o', '--output', help='Output (.wts) file path (optional)')","    parser.add_argument(","        '-t', '--type', type=str, default='detect', choices=['detect', 'cls', 'seg'],","        help='determines the model is detection/classification')","    args = parser.parse_args()","    if not os.path.isfile(args.weights):","        raise SystemExit('Invalid input file')","    if not args.output:","        args.output = os.path.splitext(args.weights)[0] + '.wts'","    elif os.path.isdir(args.output):","        args.output = os.path.join(","            args.output,","            os.path.splitext(os.path.basename(args.weights))[0] + '.wts')","    return args.weights, args.output, args.type","","","pt_file, wts_file, m_type = parse_args()","print(f'Generating .wts for {m_type} model')","","# Load model","print(f'Loading {pt_file}')","device = select_device('cpu')","model = torch.load(pt_file, map_location=device)  # Load FP32 weights","model = model['ema' if model.get('ema') else 'model'].float()","","if m_type in ['detect', 'seg']:","    # update anchor_grid info","    anchor_grid = model.model[-1].anchors * model.model[-1].stride[..., None, None]","    # model.model[-1].anchor_grid = anchor_grid","    delattr(model.model[-1], 'anchor_grid')  # model.model[-1] is detect layer","    # The parameters are saved in the OrderDict through the \"register_buffer\" method, and then saved to the weight.","    model.model[-1].register_buffer(\"anchor_grid\", anchor_grid)","    model.model[-1].register_buffer(\"strides\", model.model[-1].stride)","","model.to(device).eval()","","print(f'Writing into {wts_file}')","with open(wts_file, 'w') as f:","    f.write('{}\\n'.format(len(model.state_dict().keys())))","    for k, v in model.state_dict().items():","        vr = v.reshape(-1).cpu().numpy()","        f.write('{} {} '.format(k, len(vr)))","        for vv in vr:","            f.write(' ')","            f.write(struct.pack('>f', float(vv)).hex())","        f.write('\\n')"],"stylingDirectives":[[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":10,"cssClass":"pl-s1"}],[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":15,"cssClass":"pl-s1"}],[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":9,"cssClass":"pl-s1"}],[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":13,"cssClass":"pl-s1"}],[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":12,"cssClass":"pl-s1"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":10,"cssClass":"pl-s1"},{"start":11,"end":22,"cssClass":"pl-s1"},{"start":23,"end":29,"cssClass":"pl-k"},{"start":30,"end":43,"cssClass":"pl-s1"}],[],[],[{"start":0,"end":3,"cssClass":"pl-k"},{"start":4,"end":14,"cssClass":"pl-en"}],[{"start":4,"end":10,"cssClass":"pl-s1"},{"start":11,"end":12,"cssClass":"pl-c1"},{"start":13,"end":21,"cssClass":"pl-s1"},{"start":22,"end":36,"cssClass":"pl-v"},{"start":37,"end":48,"cssClass":"pl-s1"},{"start":48,"end":49,"cssClass":"pl-c1"},{"start":49,"end":75,"cssClass":"pl-s"}],[{"start":4,"end":10,"cssClass":"pl-s1"},{"start":11,"end":23,"cssClass":"pl-en"},{"start":24,"end":28,"cssClass":"pl-s"},{"start":30,"end":41,"cssClass":"pl-s"},{"start":43,"end":51,"cssClass":"pl-s1"},{"start":51,"end":52,"cssClass":"pl-c1"},{"start":52,"end":56,"cssClass":"pl-c1"}],[{"start":24,"end":28,"cssClass":"pl-s1"},{"start":28,"end":29,"cssClass":"pl-c1"},{"start":29,"end":71,"cssClass":"pl-s"}],[{"start":4,"end":10,"cssClass":"pl-s1"},{"start":11,"end":23,"cssClass":"pl-en"}],[{"start":8,"end":12,"cssClass":"pl-s"},{"start":14,"end":24,"cssClass":"pl-s"},{"start":26,"end":30,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-c1"},{"start":31,"end":67,"cssClass":"pl-s"}],[{"start":4,"end":10,"cssClass":"pl-s1"},{"start":11,"end":23,"cssClass":"pl-en"}],[{"start":8,"end":12,"cssClass":"pl-s"},{"start":14,"end":22,"cssClass":"pl-s"},{"start":24,"end":28,"cssClass":"pl-s1"},{"start":28,"end":29,"cssClass":"pl-c1"},{"start":29,"end":32,"cssClass":"pl-s1"},{"start":34,"end":41,"cssClass":"pl-s1"},{"start":41,"end":42,"cssClass":"pl-c1"},{"start":42,"end":50,"cssClass":"pl-s"},{"start":52,"end":59,"cssClass":"pl-s1"},{"start":59,"end":60,"cssClass":"pl-c1"},{"start":61,"end":69,"cssClass":"pl-s"},{"start":71,"end":76,"cssClass":"pl-s"},{"start":78,"end":83,"cssClass":"pl-s"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":13,"end":63,"cssClass":"pl-s"}],[{"start":4,"end":8,"cssClass":"pl-s1"},{"start":9,"end":10,"cssClass":"pl-c1"},{"start":11,"end":17,"cssClass":"pl-s1"},{"start":18,"end":28,"cssClass":"pl-en"}],[{"start":4,"end":6,"cssClass":"pl-k"},{"start":7,"end":10,"cssClass":"pl-c1"},{"start":11,"end":13,"cssClass":"pl-s1"},{"start":14,"end":18,"cssClass":"pl-s1"},{"start":19,"end":25,"cssClass":"pl-en"},{"start":26,"end":30,"cssClass":"pl-s1"},{"start":31,"end":38,"cssClass":"pl-s1"}],[{"start":8,"end":13,"cssClass":"pl-k"},{"start":14,"end":24,"cssClass":"pl-v"},{"start":25,"end":45,"cssClass":"pl-s"}],[{"start":4,"end":6,"cssClass":"pl-k"},{"start":7,"end":10,"cssClass":"pl-c1"},{"start":11,"end":15,"cssClass":"pl-s1"},{"start":16,"end":22,"cssClass":"pl-s1"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":13,"end":19,"cssClass":"pl-s1"},{"start":20,"end":21,"cssClass":"pl-c1"},{"start":22,"end":24,"cssClass":"pl-s1"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":30,"end":38,"cssClass":"pl-en"},{"start":39,"end":43,"cssClass":"pl-s1"},{"start":44,"end":51,"cssClass":"pl-s1"},{"start":53,"end":54,"cssClass":"pl-c1"},{"start":56,"end":57,"cssClass":"pl-c1"},{"start":58,"end":64,"cssClass":"pl-s"}],[{"start":4,"end":8,"cssClass":"pl-k"},{"start":9,"end":11,"cssClass":"pl-s1"},{"start":12,"end":16,"cssClass":"pl-s1"},{"start":17,"end":22,"cssClass":"pl-en"},{"start":23,"end":27,"cssClass":"pl-s1"},{"start":28,"end":34,"cssClass":"pl-s1"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":13,"end":19,"cssClass":"pl-s1"},{"start":20,"end":21,"cssClass":"pl-c1"},{"start":22,"end":24,"cssClass":"pl-s1"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":30,"end":34,"cssClass":"pl-en"}],[{"start":12,"end":16,"cssClass":"pl-s1"},{"start":17,"end":23,"cssClass":"pl-s1"}],[{"start":12,"end":14,"cssClass":"pl-s1"},{"start":15,"end":19,"cssClass":"pl-s1"},{"start":20,"end":28,"cssClass":"pl-en"},{"start":29,"end":31,"cssClass":"pl-s1"},{"start":32,"end":36,"cssClass":"pl-s1"},{"start":37,"end":45,"cssClass":"pl-en"},{"start":46,"end":50,"cssClass":"pl-s1"},{"start":51,"end":58,"cssClass":"pl-s1"},{"start":61,"end":62,"cssClass":"pl-c1"},{"start":64,"end":65,"cssClass":"pl-c1"},{"start":66,"end":72,"cssClass":"pl-s"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":15,"cssClass":"pl-s1"},{"start":16,"end":23,"cssClass":"pl-s1"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":30,"end":36,"cssClass":"pl-s1"},{"start":38,"end":42,"cssClass":"pl-s1"},{"start":43,"end":47,"cssClass":"pl-s1"}],[],[],[{"start":0,"end":7,"cssClass":"pl-s1"},{"start":9,"end":17,"cssClass":"pl-s1"},{"start":19,"end":25,"cssClass":"pl-s1"},{"start":26,"end":27,"cssClass":"pl-c1"},{"start":28,"end":38,"cssClass":"pl-en"}],[{"start":0,"end":5,"cssClass":"pl-en"},{"start":6,"end":43,"cssClass":"pl-s"},{"start":28,"end":36,"cssClass":"pl-s1"},{"start":28,"end":29,"cssClass":"pl-kos"},{"start":29,"end":35,"cssClass":"pl-s1"},{"start":35,"end":36,"cssClass":"pl-kos"}],[],[{"start":0,"end":12,"cssClass":"pl-c"}],[{"start":0,"end":5,"cssClass":"pl-en"},{"start":6,"end":26,"cssClass":"pl-s"},{"start":16,"end":25,"cssClass":"pl-s1"},{"start":16,"end":17,"cssClass":"pl-kos"},{"start":17,"end":24,"cssClass":"pl-s1"},{"start":24,"end":25,"cssClass":"pl-kos"}],[{"start":0,"end":6,"cssClass":"pl-s1"},{"start":7,"end":8,"cssClass":"pl-c1"},{"start":9,"end":22,"cssClass":"pl-en"},{"start":23,"end":28,"cssClass":"pl-s"}],[{"start":0,"end":5,"cssClass":"pl-s1"},{"start":6,"end":7,"cssClass":"pl-c1"},{"start":8,"end":13,"cssClass":"pl-s1"},{"start":14,"end":18,"cssClass":"pl-en"},{"start":19,"end":26,"cssClass":"pl-s1"},{"start":28,"end":40,"cssClass":"pl-s1"},{"start":40,"end":41,"cssClass":"pl-c1"},{"start":41,"end":47,"cssClass":"pl-s1"},{"start":50,"end":69,"cssClass":"pl-c"}],[{"start":0,"end":5,"cssClass":"pl-s1"},{"start":6,"end":7,"cssClass":"pl-c1"},{"start":8,"end":13,"cssClass":"pl-s1"},{"start":14,"end":19,"cssClass":"pl-s"},{"start":20,"end":22,"cssClass":"pl-k"},{"start":23,"end":28,"cssClass":"pl-s1"},{"start":29,"end":32,"cssClass":"pl-en"},{"start":33,"end":38,"cssClass":"pl-s"},{"start":40,"end":44,"cssClass":"pl-k"},{"start":45,"end":52,"cssClass":"pl-s"},{"start":54,"end":59,"cssClass":"pl-en"}],[],[{"start":0,"end":2,"cssClass":"pl-k"},{"start":3,"end":9,"cssClass":"pl-s1"},{"start":10,"end":12,"cssClass":"pl-c1"},{"start":14,"end":22,"cssClass":"pl-s"},{"start":24,"end":29,"cssClass":"pl-s"}],[{"start":4,"end":29,"cssClass":"pl-c"}],[{"start":4,"end":15,"cssClass":"pl-s1"},{"start":16,"end":17,"cssClass":"pl-c1"},{"start":18,"end":23,"cssClass":"pl-s1"},{"start":24,"end":29,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-c1"},{"start":31,"end":32,"cssClass":"pl-c1"},{"start":34,"end":41,"cssClass":"pl-s1"},{"start":42,"end":43,"cssClass":"pl-c1"},{"start":44,"end":49,"cssClass":"pl-s1"},{"start":50,"end":55,"cssClass":"pl-s1"},{"start":56,"end":57,"cssClass":"pl-c1"},{"start":57,"end":58,"cssClass":"pl-c1"},{"start":60,"end":66,"cssClass":"pl-s1"},{"start":72,"end":76,"cssClass":"pl-c1"},{"start":78,"end":82,"cssClass":"pl-c1"}],[{"start":4,"end":47,"cssClass":"pl-c"}],[{"start":4,"end":11,"cssClass":"pl-en"},{"start":12,"end":17,"cssClass":"pl-s1"},{"start":18,"end":23,"cssClass":"pl-s1"},{"start":24,"end":25,"cssClass":"pl-c1"},{"start":25,"end":26,"cssClass":"pl-c1"},{"start":29,"end":42,"cssClass":"pl-s"},{"start":45,"end":78,"cssClass":"pl-c"}],[{"start":4,"end":115,"cssClass":"pl-c"}],[{"start":4,"end":9,"cssClass":"pl-s1"},{"start":10,"end":15,"cssClass":"pl-s1"},{"start":16,"end":17,"cssClass":"pl-c1"},{"start":17,"end":18,"cssClass":"pl-c1"},{"start":20,"end":35,"cssClass":"pl-en"},{"start":36,"end":49,"cssClass":"pl-s"},{"start":51,"end":62,"cssClass":"pl-s1"}],[{"start":4,"end":9,"cssClass":"pl-s1"},{"start":10,"end":15,"cssClass":"pl-s1"},{"start":16,"end":17,"cssClass":"pl-c1"},{"start":17,"end":18,"cssClass":"pl-c1"},{"start":20,"end":35,"cssClass":"pl-en"},{"start":36,"end":45,"cssClass":"pl-s"},{"start":47,"end":52,"cssClass":"pl-s1"},{"start":53,"end":58,"cssClass":"pl-s1"},{"start":59,"end":60,"cssClass":"pl-c1"},{"start":60,"end":61,"cssClass":"pl-c1"},{"start":63,"end":69,"cssClass":"pl-s1"}],[],[{"start":0,"end":5,"cssClass":"pl-s1"},{"start":6,"end":8,"cssClass":"pl-en"},{"start":9,"end":15,"cssClass":"pl-s1"},{"start":17,"end":21,"cssClass":"pl-en"}],[],[{"start":0,"end":5,"cssClass":"pl-en"},{"start":6,"end":32,"cssClass":"pl-s"},{"start":21,"end":31,"cssClass":"pl-s1"},{"start":21,"end":22,"cssClass":"pl-kos"},{"start":22,"end":30,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-kos"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":9,"cssClass":"pl-en"},{"start":10,"end":18,"cssClass":"pl-s1"},{"start":20,"end":23,"cssClass":"pl-s"},{"start":25,"end":27,"cssClass":"pl-k"},{"start":28,"end":29,"cssClass":"pl-s1"}],[{"start":4,"end":5,"cssClass":"pl-s1"},{"start":6,"end":11,"cssClass":"pl-en"},{"start":12,"end":18,"cssClass":"pl-s"},{"start":15,"end":17,"cssClass":"pl-cce"},{"start":19,"end":25,"cssClass":"pl-en"},{"start":26,"end":29,"cssClass":"pl-en"},{"start":30,"end":35,"cssClass":"pl-s1"},{"start":36,"end":46,"cssClass":"pl-en"},{"start":49,"end":53,"cssClass":"pl-en"}],[{"start":4,"end":7,"cssClass":"pl-k"},{"start":8,"end":9,"cssClass":"pl-s1"},{"start":11,"end":12,"cssClass":"pl-s1"},{"start":13,"end":15,"cssClass":"pl-c1"},{"start":16,"end":21,"cssClass":"pl-s1"},{"start":22,"end":32,"cssClass":"pl-en"},{"start":35,"end":40,"cssClass":"pl-en"}],[{"start":8,"end":10,"cssClass":"pl-s1"},{"start":11,"end":12,"cssClass":"pl-c1"},{"start":13,"end":14,"cssClass":"pl-s1"},{"start":15,"end":22,"cssClass":"pl-en"},{"start":23,"end":24,"cssClass":"pl-c1"},{"start":24,"end":25,"cssClass":"pl-c1"},{"start":27,"end":30,"cssClass":"pl-en"},{"start":33,"end":38,"cssClass":"pl-en"}],[{"start":8,"end":9,"cssClass":"pl-s1"},{"start":10,"end":15,"cssClass":"pl-en"},{"start":16,"end":24,"cssClass":"pl-s"},{"start":25,"end":31,"cssClass":"pl-en"},{"start":32,"end":33,"cssClass":"pl-s1"},{"start":35,"end":38,"cssClass":"pl-en"},{"start":39,"end":41,"cssClass":"pl-s1"}],[{"start":8,"end":11,"cssClass":"pl-k"},{"start":12,"end":14,"cssClass":"pl-s1"},{"start":15,"end":17,"cssClass":"pl-c1"},{"start":18,"end":20,"cssClass":"pl-s1"}],[{"start":12,"end":13,"cssClass":"pl-s1"},{"start":14,"end":19,"cssClass":"pl-en"},{"start":20,"end":23,"cssClass":"pl-s"}],[{"start":12,"end":13,"cssClass":"pl-s1"},{"start":14,"end":19,"cssClass":"pl-en"},{"start":20,"end":26,"cssClass":"pl-s1"},{"start":27,"end":31,"cssClass":"pl-en"},{"start":32,"end":36,"cssClass":"pl-s"},{"start":38,"end":43,"cssClass":"pl-en"},{"start":44,"end":46,"cssClass":"pl-s1"},{"start":49,"end":52,"cssClass":"pl-en"}],[{"start":8,"end":9,"cssClass":"pl-s1"},{"start":10,"end":15,"cssClass":"pl-en"},{"start":16,"end":20,"cssClass":"pl-s"},{"start":17,"end":19,"cssClass":"pl-cce"}]],"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/wang-xinyu/tensorrtx/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null,"repoAlertsPath":"/wang-xinyu/tensorrtx/security/dependabot","repoSecurityAndAnalysisPath":"/wang-xinyu/tensorrtx/settings/security_analysis","repoOwnerIsOrg":false,"currentUserCanAdminRepo":false},"displayName":"gen_wts.py","displayUrl":"https://github.com/wang-xinyu/tensorrtx/blob/master/yolov5/gen_wts.py?raw=true","headerInfo":{"blobSize":"2.2 KB","deleteInfo":{"deleteTooltip":"You must be signed in to make or propose changes"},"editInfo":{"editTooltip":"You must be signed in to make or propose changes"},"ghDesktopPath":"https://desktop.github.com","gitLfsPath":null,"onBranch":true,"shortPath":"789e5d7","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fwang-xinyu%2Ftensorrtx%2Fblob%2Fmaster%2Fyolov5%2Fgen_wts.py","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"59","truncatedSloc":"51"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplateHelpUrl":"https://docs.github.com/articles/about-issue-and-pull-request-templates","issueTemplate":null,"discussionTemplate":null,"language":"Python","languageID":303,"large":false,"loggedIn":false,"newDiscussionPath":"/wang-xinyu/tensorrtx/discussions/new","newIssuePath":"/wang-xinyu/tensorrtx/issues/new","planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/wang-xinyu/tensorrtx/blob/master/yolov5/gen_wts.py","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","dismissStackNoticePath":"/settings/dismiss-notice/publish_stack_from_file","releasePath":"/wang-xinyu/tensorrtx/releases/new?marketplace=true","showPublishActionBanner":false,"showPublishStackBanner":false},"rawBlobUrl":"https://github.com/wang-xinyu/tensorrtx/raw/master/yolov5/gen_wts.py","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"repoOwner":"wang-xinyu","repoName":"tensorrtx","showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","showDependabotConfigurationBanner":false,"actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timedOut":false,"notAnalyzed":false,"symbols":[{"name":"parse_args","kind":"function","identStart":114,"identEnd":124,"extentStart":110,"extentEnd":1033,"fullyQualifiedName":"parse_args","identUtf16":{"start":{"lineNumber":8,"utf16Col":4},"end":{"lineNumber":8,"utf16Col":14}},"extentUtf16":{"start":{"lineNumber":8,"utf16Col":0},"end":{"lineNumber":26,"utf16Col":47}}},{"name":"device","kind":"constant","identStart":1164,"identEnd":1170,"extentStart":1164,"extentEnd":1193,"fullyQualifiedName":"device","identUtf16":{"start":{"lineNumber":34,"utf16Col":0},"end":{"lineNumber":34,"utf16Col":6}},"extentUtf16":{"start":{"lineNumber":34,"utf16Col":0},"end":{"lineNumber":34,"utf16Col":29}}},{"name":"model","kind":"constant","identStart":1194,"identEnd":1199,"extentStart":1194,"extentEnd":1242,"fullyQualifiedName":"model","identUtf16":{"start":{"lineNumber":35,"utf16Col":0},"end":{"lineNumber":35,"utf16Col":5}},"extentUtf16":{"start":{"lineNumber":35,"utf16Col":0},"end":{"lineNumber":35,"utf16Col":48}}},{"name":"model","kind":"constant","identStart":1264,"identEnd":1269,"extentStart":1264,"extentEnd":1325,"fullyQualifiedName":"model","identUtf16":{"start":{"lineNumber":36,"utf16Col":0},"end":{"lineNumber":36,"utf16Col":5}},"extentUtf16":{"start":{"lineNumber":36,"utf16Col":0},"end":{"lineNumber":36,"utf16Col":61}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/wang-xinyu/tensorrtx/branches":{"post":"DxAGXrkSpiMnbMjqztgIk-X2dMHoc29OcmFOUA7o0RzjvhnpTN2CazBm3xLMqNZzuheobXuiCb0HyNnXfKgG5g"},"/repos/preferences":{"post":"W7W7D6HFgi-jqyGYOTrEMdM-kfm3fvXYtOK00m63uaK-clP9rMYOGv9VfNf5KwdAIp6yLkPAytYTDaryJiqNBA"}}},"title":"tensorrtx/yolov5/gen_wts.py at master · wang-xinyu/tensorrtx"}
NameError: name 'false' is not defined

what can I do?

wang-xinyu commented 9 months ago

Did you try the official trained model yolov5.pt? If that works, then compare yours with it.

stale[bot] commented 7 months ago

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.