yuexy / ps-vit Goto Github PK
View Code? Open in Web Editor NEWOfficial implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.
License: MIT License
Official implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.
License: MIT License
Thank you for your awesome work. I have followed all steps for training your model; however, I encountered the following error which happens for importing your model in line 9 of main.py (import models
). Although it seems that models have not been used anywhere in main.py, when I commented import models
, another error would occur in line 315 in create_model
of main.py.
I would be grateful if you could guide me to deal with this issue.
Traceback (most recent call last):
File "/home/amir/Documents/PS-ViT/main.py", line 9, in <module>
import models
File "/home/amir/Documents/PS-ViT/models/_init_.py", line 1, in <module>
from .ps_vit import *
File "/home/amir/Documents/PS-ViT/models/ps_vit.py", line 4, in <module>
from timm.models.helpers import load_pretrained
File "/home/amir/anaconda3/envs/ps_vit/lib/python3.7/site-packages/timm/_init_.py", line 2, in <module>
from .models import create_model, list_models, is_model, list_modules, model_entrypoint, \
File "/home/amir/anaconda3/envs/ps_vit/lib/python3.7/site-packages/timm/models/_init_.py", line 1, in <module>
from .ps_vit import *
File "/home/amir/anaconda3/envs/ps_vit/lib/python3.7/site-packages/timm/models/ps_vit.py", line 8, in <module>
from layers import ProgressiveSample
File "/home/amir/Documents/PS-ViT/layers/_init_.py", line 1, in <module>
from .progressive_sample import ProgressiveSample
File "/home/amir/Documents/PS-ViT/layers/progressive_sample.py", line 9, in <module>
'progressive_sampling_backward'])
File "/home/amir/Documents/PS-ViT/utils/ext_loader.py", line 5, in load_ext
ext = importlib.import_module(name)
File "/home/amir/anaconda3/envs/ps_vit/lib/python3.7/importlib/_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_ext'
Process finished with exit code 1
Traceback (most recent call last):
File "D:\Lenovo\PycharmProjects\PS-ViT-master\utils\ext_loader.py", line 12, in
ext_module = load_ext('ext', ['progressive_sampling_forward', 'progressive_sampling_backward'])
File "D:\Lenovo\PycharmProjects\PS-ViT-master\utils\ext_loader.py", line 5, in load_ext
ext = importlib.import_module(name)
File "D:\Anaconda3\envs\python39\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 565, in module_from_spec
File "", line 1108, in create_module
File "", line 228, in _call_with_frames_removed
ImportError: DLL load failed while importing _ext: 找不到指定的模块。
Hello! I installed under the instructions (PyTorch==1.7.1 and torchvision==0.8.2 with CUDA==10.1). When I install apex using "pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./", it successfully finished. However, when I run the code, there is an error from "import apex", that is "fused_weight_gradient_mlp_cuda module not found. gradient accumulation fusion with weight gradient computation disabled." Have anyone met this problem? Thank you very much!
I have done your installation setup step-by-step, but unfortunately the train from scratch bash file not working. this is the log file that code have generated on the output file
usage: main.py [-h] [--data DIR] [--data_train_root DATA_TRAIN_ROOT]
[--data_train_label DATA_TRAIN_LABEL]
[--data_val_root DATA_VAL_ROOT]
[--data_val_label DATA_VAL_LABEL] [--model MODEL]
[--pretrained] [--initial-checkpoint PATH] [--resume PATH]
[--eval_checkpoint PATH] [--no-resume-opt] [--num-classes N]
[--gp POOL] [--img-size N] [--crop-pct N]
[--mean MEAN [MEAN ...]] [--std STD [STD ...]]
[--interpolation NAME] [-b N] [-vb N] [--opt OPTIMIZER]
[--opt-eps EPSILON] [--opt-betas BETA [BETA ...]]
[--momentum M] [--weight-decay WEIGHT_DECAY] [--clip-grad NORM]
[--sched SCHEDULER] [--lr LR]
[--lr-noise pct, pct [pct, pct ...]] [--lr-noise-pct PERCENT]
[--lr-noise-std STDDEV] [--lr-cycle-mul MULT]
[--lr-cycle-limit N] [--warmup-lr LR] [--min-lr LR]
[--epochs N] [--start-epoch N] [--decay-epochs N]
[--warmup-epochs N] [--cooldown-epochs N] [--patience-epochs N]
[--decay-rate RATE] [--no-aug] [--scale PCT [PCT ...]]
[--ratio RATIO [RATIO ...]] [--hflip HFLIP] [--vflip VFLIP]
[--color-jitter PCT] [--aa NAME] [--aug-splits AUG_SPLITS]
[--jsd] [--reprob PCT] [--remode REMODE] [--recount RECOUNT]
[--resplit] [--mixup MIXUP] [--cutmix CUTMIX]
[--cutmix-minmax CUTMIX_MINMAX [CUTMIX_MINMAX ...]]
[--mixup-prob MIXUP_PROB]
[--mixup-switch-prob MIXUP_SWITCH_PROB]
[--mixup-mode MIXUP_MODE] [--mixup-off-epoch N]
[--smoothing SMOOTHING]
[--train-interpolation TRAIN_INTERPOLATION] [--drop PCT]
[--drop-connect PCT] [--drop-path PCT] [--drop-block PCT]
[--bn-tf] [--bn-momentum BN_MOMENTUM] [--bn-eps BN_EPS]
[--sync-bn] [--dist-bn DIST_BN] [--split-bn] [--model-ema]
[--model-ema-force-cpu] [--model-ema-decay MODEL_EMA_DECAY]
[--seed S] [--log-interval N] [--recovery-interval N] [-j N]
[--num-gpu NUM_GPU] [--save-images] [--amp] [--apex-amp]
[--native-amp] [--channels-last] [--pin-mem] [--no-prefetcher]
[--output PATH] [--eval-metric EVAL_METRIC] [--tta N]
[--local_rank LOCAL_RANK] [--use-multi-epochs-loader]
[--distributed DISTRIBUTED] [--port PORT]
[--repeated_aug REPEATED_AUG]
main.py: error: unrecognized arguments: main.py
It seems that CNN stem can effect the model performance, but in Table 7, you just compare PS-ViT with the vanilla ViT. Have you ever tried to compare your PS-ViT with the same CNN stem equipped ViT?
Hi, Xiaoyu
This PS-ViT is an excellent work! And I have a little question want to ask: When I train the sampling location offsets network, the output offsets are always very high (nearly the H/W of the image) or low (nearly 0). Have you ever encountered this kind of problem? How do you limit the range of the learned offsets?
Looking forward to your reply! Thanks!
Hi,
I have trained PS-ViT-Ti/14 following the default setting in the code. But the performance is only 74.6, which is lower than 75.6 in the paper. Could you show more training details?
Hello,
Thank you for sharing. I have some problems downloading pre training weights. I hope to get your help. I can't use Google drive to download ps-vit-b / 14 and ps-vit-b / 18 pre training weights. I hope you can provide Baidu online disk and other download methods.Thank you very much.
excuse me i'm facing this problem
This program was compiled against version 3.9.2 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.17.1). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "bazel-out/k8-opt/bin/tensorflow/core/framework/tensor_shape.pb.cc".)
python3 main.py --model <ps_vit_b_14.pth> -b <14> --eval_checkpoint <D:\pythonProject-to-checkpoint>
显示命令语法错误该如何修改
This PS-ViT is an excellent work!
I am confused.
Why not use the function torch.nn.functional.grid_sample in pytorch, but use cuda code to implement it by yourself?
What is the difference between them?
In your code:
sample_feat = self.sampler(x, point, offset)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.