Coder Social home page Coder Social logo

bugs about mae-pytorch HOT 9 CLOSED

cuge1995 avatar cuge1995 commented on June 26, 2024
bugs

from mae-pytorch.

Comments (9)

launchauto avatar launchauto commented on June 26, 2024 1
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.

pengzhiliang avatar pengzhiliang commented on June 26, 2024

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.

cuge1995 avatar cuge1995 commented on June 26, 2024

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.

cuge1995 avatar cuge1995 commented on June 26, 2024

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.

LiewFeng avatar LiewFeng commented on June 26, 2024

I can run it successfully. Maybe you can check the version of timm.

from mae-pytorch.

chenhao-zju avatar chenhao-zju commented on June 26, 2024

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.

pengzhiliang avatar pengzhiliang commented on June 26, 2024

Hello, @shandong-university-weihai-chen . You can have a try:

pip install timm==0.3.2

from mae-pytorch.

chenhao-zju avatar chenhao-zju commented on June 26, 2024

It’s very nice of you, I solve this problem by changing all ‘>=’ to ‘==’ in ‘requirements.txt’

from mae-pytorch.

pengzhiliang avatar pengzhiliang commented on June 26, 2024

You are welcome.

from mae-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.