demo代码无法在mac电脑上运行
- Dominant language
- Python
- Stars
- 9k
- Forks
- 775
- PR merge metrics
- No merged PRs in 30d
Description
运行环境:macpro M2Pro芯片,Python3.10
完整日志如下:
python demo_page_hf.py --model_path ./hf_model --input_path ./demo/page_imgs/page_1.jpeg --save_dir ./results
Config of the encoder: is overwritten by shared encoder config: DonutSwinConfig {
"attention_probs_dropout_prob": 0.0,
"depths": [
2,
2,
14,
2
],
"drop_path_rate": 0.1,
"embed_dim": 128,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.0,
"hidden_size": 1024,
"image_size": [
1024,
1024
],
"initializer_range": 0.02,
"layer_norm_eps": 1e-05,
"mlp_ratio": 4.0,
"model_type": "donut-swin",
"num_channels": 3,
"num_heads": [
4,
8,
16,
32
],
"num_layers": 4,
"patch_size": 4,
"qkv_bias": true,
"transformers_version": "4.47.0",
"use_absolute_embeddings": false,
"window_size": 8
}
Config of the decoder: is overwritten by shared decoder config: MBartConfig {
"activation_dropout": 0.0,
"activation_function": "gelu",
"add_cross_attention": true,
"add_final_layer_norm": true,
"attention_dropout": 0.0,
"bos_token_id": 0,
"classifier_dropout": 0.0,
"d_model": 1024,
"decoder_attention_heads": 16,
"decoder_ffn_dim": 4096,
"decoder_layerdrop": 0.0,
"decoder_layers": 10,
"dropout": 0.1,
"encoder_attention_heads": 16,
"encoder_ffn_dim": 4096,
"encoder_layerdrop": 0.0,
"encoder_layers": 12,
"eos_token_id": 2,
"forced_eos_token_id": 2,
"init_std": 0.02,
"is_decoder": true,
"is_encoder_decoder": false,
"max_position_embeddings": 4096,
"model_type": "mbart",
"num_hidden_layers": 12,
"pad_token_id": 1,
"scale_embedding": true,
"tie_word_embeddings": false,
"transformers_version": "4.47.0",
"use_cache": true,
"vocab_size": 73921
}
Total samples to process: 1
Processing ./demo/page_imgs/page_1.jpeg
Legacy behavior is being used. The current behavior will be deprecated in version 5.0.0. In the new behavior, if both images and text are provided, the default value of `add_special_tokens` will be changed to `False` when calling the tokenizer if `add_special_tokens` is unset. To test the new behavior, set `legacy=False`as a processor call argument.
Error processing ./demo/page_imgs/page_1.jpeg: "slow_conv2d_cpu" not implemented for 'Half'
最后,报错了"slow_conv2d_cpu" not implemented for 'Half'
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with demo_page_hf.py and reproduce the command on the reported M2 Pro and Python 3.10 environment. Trace the device and precision handling associated with the `slow_conv2d_cpu` error; done means the demo processes page_1.jpeg and writes results without this failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100