{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"raw","source":"import torch\n#model_path = \"/kaggle/input/clip-match/clip_H_14_arc_withnewdata_val0.6456693_epoch4_256emb_s30m0.5.pt\"\nmodel_path = \"/kaggle/input/universalv5/BIG_DATA_EPOCH4_no_pool.pt\"\n","metadata":{"execution":{"iopub.status.busy":"2023-06-06T14:07:54.89379Z","iopub.execute_input":"2023-06-06T14:07:54.8941Z","iopub.status.idle":"2023-06-06T14:07:57.938799Z","shell.execute_reply.started":"2023-06-06T14:07:54.894067Z","shell.execute_reply":"2023-06-06T14:07:57.937889Z"}}},{"cell_type":"code","source":"# !pip install open_clip_torch","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.531823Z","iopub.execute_input":"2023-06-08T21:29:48.532528Z","iopub.status.idle":"2023-06-08T21:29:48.563381Z","shell.execute_reply.started":"2023-06-08T21:29:48.532485Z","shell.execute_reply":"2023-06-08T21:29:48.562107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# import open_clip\n# import torch\n# model = open_clip.create_model_and_transforms('ViT-H-14', pretrained='laion2b_s32b_b79k')[0].visual\n# model = model.to('cuda').eval()\n# saved_model = torch.jit.script(model)\n# saved_model.save(\"vit_h_14_open.pt\")","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.565952Z","iopub.execute_input":"2023-06-08T21:29:48.566663Z","iopub.status.idle":"2023-06-08T21:29:48.572098Z","shell.execute_reply.started":"2023-06-08T21:29:48.566613Z","shell.execute_reply":"2023-06-08T21:29:48.570735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# import gc\n# del model","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.574119Z","iopub.execute_input":"2023-06-08T21:29:48.574764Z","iopub.status.idle":"2023-06-08T21:29:48.584470Z","shell.execute_reply.started":"2023-06-08T21:29:48.574718Z","shell.execute_reply":"2023-06-08T21:29:48.582845Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# gc.collect()","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.588354Z","iopub.execute_input":"2023-06-08T21:29:48.588794Z","iopub.status.idle":"2023-06-08T21:29:48.596677Z","shell.execute_reply.started":"2023-06-08T21:29:48.588750Z","shell.execute_reply":"2023-06-08T21:29:48.594984Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# model = open_clip.create_model_and_transforms('ViT-g-14', pretrained='laion2b_s34b_b88k')[0].visual","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.598503Z","iopub.execute_input":"2023-06-08T21:29:48.599859Z","iopub.status.idle":"2023-06-08T21:29:48.607683Z","shell.execute_reply.started":"2023-06-08T21:29:48.599817Z","shell.execute_reply":"2023-06-08T21:29:48.606320Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# model = model.to('cuda').eval()\n# saved_model = torch.jit.script(model)\n# saved_model.save(\"vit_g_14_open.pt\")","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.610706Z","iopub.execute_input":"2023-06-08T21:29:48.611085Z","iopub.status.idle":"2023-06-08T21:29:48.619938Z","shell.execute_reply.started":"2023-06-08T21:29:48.611053Z","shell.execute_reply":"2023-06-08T21:29:48.618787Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import timm\nmodel=timm.create_model('convnext_xlarge_in22k',pretrained = True)\nweights_path = model.default_cfg['url']\n!wget $weights_path\n","metadata":{"execution":{"iopub.status.busy":"2023-06-08T21:29:48.622040Z","iopub.execute_input":"2023-06-08T21:29:48.622507Z","iopub.status.idle":"2023-06-08T21:30:10.521816Z","shell.execute_reply.started":"2023-06-08T21:29:48.622465Z","shell.execute_reply":"2023-06-08T21:30:10.519554Z"},"trusted":true},"execution_count":null,"outputs":[]}]}