Comments (9)
MAE-pytorch/modeling_pretrain.py", line 296, in pretrain_mae_base_patch16_224 **kwargs) TypeError: __init__() got an unexpected keyword argument 'num_classes'
command
pip install --upgrade timm
will help
from mae-pytorch.
I'm sorry that I can't reproduce the bug you mentioned with the unmodified code in this repo. Can you provide more information?
from mae-pytorch.
just clone your repo, and follow the running code
# Set the path to save checkpoints
OUTPUT_DIR='output/'
# path to imagenet-1k train set
DATA_PATH='../ImageNet_ILSVRC2012/train'
OMP_NUM_THREADS=1 python -m torch.distributed.launch --nproc_per_node=8 run_mae_pretraining.py \
--data_path ${DATA_PATH} \
--mask_ratio 0.75 \
--model pretrain_mae_base_patch16_224 \
--batch_size 128 \
--opt_betas 0.9 0.95 \
--warmup_epochs 40 \
--epochs 1600 \
--output_dir ${OUTPUT_DIR}
from mae-pytorch.
more logs are as follows:
Creating model: pretrain_mae_base_patch16_224
Traceback (most recent call last):
File "run_mae_pretraining.py", line 264, in <module>
main(opts)
File "run_mae_pretraining.py", line 150, in main
model = get_model(args)
File "run_mae_pretraining.py", line 129, in get_model
drop_block_rate=None,
File "timm/models/factory.py", line 57, in create_model
model = create_fn(**model_args, **kwargs)
File "MAE-pytorch/modeling_pretrain.py", line 296, in pretrain_mae_base_patch16_224
**kwargs)
TypeError: __init__() got an unexpected keyword argument 'num_classes'
Traceback (most recent call last):
from mae-pytorch.
I can run it successfully. Maybe you can check the version of timm.
from mae-pytorch.
MAE-pytorch/modeling_pretrain.py", line 296, in pretrain_mae_base_patch16_224
**kwargs)
TypeError: init() got an unexpected keyword argument 'num_classes'
Have you solved this problem? I met it too
from mae-pytorch.
Hello, @shandong-university-weihai-chen . You can have a try:
pip install timm==0.3.2
from mae-pytorch.
It’s very nice of you, I solve this problem by changing all ‘>=’ to ‘==’ in ‘requirements.txt’
from mae-pytorch.
You are welcome.
from mae-pytorch.
Related Issues (20)
- pil_loader slowly
- typo error local-rank HOT 1
- TypeError: __init__() got an unexpected keyword argument 'pretrained_cfg'
- Do I need to specify the value of mask_ratio before finetune?
- training with 400 epoch has IndexError when training at the last iteration
- Which dataset is used for the released pretrained model?
- A warning when pretraining HOT 2
- Pretrained weight of vit-S
- Patch size for pretraining
- learning rate curve
- Visualize Problems HOT 2
- How to resume from the checkpoint?
- SimMIM test
- I wonder if you plan to release the mask prediction visualization code?
- RuntimeError: Given normalized_shape=[768], expected input with shape [*, 768], but got input of size[12]
- Visual loading model error HOT 6
- How to implement Layer-wise learning rate decay on ResNet?
- Error reported in code finetune, AttributeError: 'VisionTransformer' object has no attribute 'get_num_layers'.
- The import accimage cannot be parsed
- Is Mixup necessary for MAE fine-tuning?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mae-pytorch.