-
Notifications
You must be signed in to change notification settings - Fork 320
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
Hvt #146
Conversation
The code of HVT is released and models are in the 'models' folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check the coding style in hvt.py
image_classification/HVT/README.md
Outdated
|
||
The official pytorch implementation is [here](). | ||
|
||
This implementation is developed by [PaddleViT](https://github.com/zhuang-group/HVT). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the correct PaddleViT link and official implementation link
image_classification/HVT/hvt.py
Outdated
droppath=config.MODEL.DROPPATH) | ||
return model | ||
|
||
# from config import get_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unrelated code
image_classification/HVT/hvt.py
Outdated
def build_hvt(config): | ||
"""build deit model using config""" | ||
model = HVT(image_size=config.DATA.IMAGE_SIZE, | ||
in_channels=config.MODEL.TRANS.IN_CHANNELS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use correct code indent
image_classification/HVT/hvt.py
Outdated
from droppath import DropPath | ||
|
||
|
||
def print_model_named_params(model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unrelated/debug code
criterion_val = nn.CrossEntropyLoss() | ||
|
||
|
||
# 5. Create Teacher model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not used
|
||
# STEP 5: Define optimizer and lr_scheduler | ||
# set lr according to batch size and world size (hacked from Swin official code and modified for CSwin) | ||
if config.TRAIN.LINEAR_SCALED_LR is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no LINEAR_SCALED_LR in config.py, please add this keyword in config.py
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""DeiT training/validation using single GPU """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeiT -> HvT
parser.add_argument('-pretrained', type=str, default=None) | ||
parser.add_argument('-resume', type=str, default=None) | ||
parser.add_argument('-last_epoch', type=int, default=None) | ||
parser.add_argument('-teacher_model', type=str, default=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove if not used
# STEP 5: Create Teacher model | ||
teacher_model = None | ||
|
||
# STEP 6: Define optimizer and lr_scheduler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use similar "if condition " as main_multi_gpu.py
add argument -output for image_classification(close #142)
add missing world size for lr linear scale in main_multi_gpu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the .xxx files in the repo and correct the coding styles in hvt.py
LGTM |
Code of HVT is released