Open Eheran1 opened 4 months ago
Were you able to find a solution to this? I'm experiencing the same error.
I found a solution using git lfs before cloning the repo:
Install git lfs (https://git-lfs.github.com/): sudo apt-get install git-lfs Set it up: git lfs install
I got it to run doing the following after deleting the old environment: In Anaconda CMD
cd <folder where you want the analog_gauge_reader folder to be in>
git clone https://github.com/ethz-asl/analog_gauge_reader
cd <path to your analog_gauge_reader folder>
conda create --name gauge_reader python=3.8 -y
conda activate gauge_reader
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 -c pytorch -c nvidia
pip install -U openmim
mim install mmengine==0.7.2
mim install mmcv==2.0.0
mim install mmdet==3.0.0
mim install mmocr==1.0.0
pip install ultralytics==8.0.66
pip install -U scikit-learn==1.2.2
I then put a picture in a new folder "Pictures" and run the script like this:
cd <path to your analog_gauge_reader folder>
python pipeline.py --detection_model models/gauge_detection_model.pt --segmentation_model models/segmentation_model.pt --key_point_model models/key_point_model.pt --base_path results --input Pictures --debug --eval
This seems to work and give me the expected result. But even when running it without --debug --eval, I get a ton of errors on the way:
>python pipeline.py --detection_model models/gauge_detection_model.pt --segmentation_model models/segmentation_model.pt --key_point_model models/key_point_model.pt --base_path results --input Pictures
0: 480x640 3 Gauge Faces, 30.6ms
Speed: 1.0ms preprocess, 30.6ms inference, 8.5ms postprocess per image at shape (1, 3, 640, 640)
Using cache found in C:\Users\[me]/.cache\torch\hub\facebookresearch_dinov2_main
C:\Users\[me]/.cache\torch\hub\facebookresearch_dinov2_main\dinov2\layers\swiglu_ffn.py:51: UserWarning: xFormers is not available (SwiGLU)
warnings.warn("xFormers is not available (SwiGLU)")
C:\Users\[me]/.cache\torch\hub\facebookresearch_dinov2_main\dinov2\layers\attention.py:33: UserWarning: xFormers is not available (Attention)
warnings.warn("xFormers is not available (Attention)")
C:\Users\[me]/.cache\torch\hub\facebookresearch_dinov2_main\dinov2\layers\block.py:40: UserWarning: xFormers is not available (Block)
warnings.warn("xFormers is not available (Block)")
C:\ProgramData\anaconda3\envs\gauge_reader\lib\site-packages\sklearn\cluster\_kmeans.py:1382: UserWarning: KMeans is known to have a memory leak on Windows with MKL, when there are less chunks than available threads. You can avoid it by setting the environment variable OMP_NUM_THREADS=3.
warnings.warn(
C:\ProgramData\anaconda3\envs\gauge_reader\lib\site-packages\sklearn\cluster\_kmeans.py:1382: UserWarning: KMeans is known to have a memory leak on Windows with MKL, when there are less chunks than available threads. You can avoid it by setting the environment variable OMP_NUM_THREADS=1.
warnings.warn(
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmocr/textdet/dbnet/dbnet_resnet18_fpnc_1200e_icdar2015/dbnet_resnet18_fpnc_1200e_icdar2015_20220825_221614-7c0e94f2.pth
The model and loaded state dict do not match exactly
unexpected key in source state_dict: data_preprocessor.mean, data_preprocessor.std
08/06 15:32:23 - mmengine - WARNING - Failed to search registry with scope "mmocr" in the "function" registry tree. As a workaround, the current "function" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmocr" is a correct scope, or whether the registry is initialized.
08/06 15:32:23 - mmengine - WARNING - `Visualizer` backend is not initialized because save_dir is None.
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmocr/textrecog/abinet/abinet_20e_st-an_mj/abinet_20e_st-an_mj_20221005_012617-ead8c139.pth
C:\ProgramData\anaconda3\envs\gauge_reader\lib\site-packages\mmocr\models\textrecog\module_losses\ce_module_loss.py:101: UserWarning: padding does not exist in the dictionary
warnings.warn(
C:\ProgramData\anaconda3\envs\gauge_reader\lib\site-packages\mmocr\models\textrecog\postprocessors\base.py:60: UserWarning: padding does not exist in the dictionary
warnings.warn(
The model and loaded state dict do not match exactly
unexpected key in source state_dict: data_preprocessor.mean, data_preprocessor.std
C:\ProgramData\anaconda3\envs\gauge_reader\lib\site-packages\mmcv\cnn\bricks\transformer.py:819: UserWarning: Use same attn_mask in all
attentions in BaseTransformerLayer
warnings.warn(f'Use same attn_mask in all attentions in '
C:\ProgramData\anaconda3\envs\gauge_reader\lib\site-packages\torch\nn\functional.py:4999: UserWarning: Support for mismatched
key_padding_mask and attn_mask is deprecated. Use same type for both instead.
warnings.warn(
Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0: 640x640 1 Gauge Needle, 15.0ms
Speed: 1.5ms preprocess, 15.0ms inference, 48.6ms postprocess per image at shape (1, 3, 640, 640)
hello!I am a student and i want try your project but I don't know how to get picture the project need,so can you share the data of the project need to me,thank you very much!
or can you tell me how get the picture need in your project?
The pictures are pictures of gauges. Here a random picture on the internet you can try
hellow! can you tell me how your data file is set up and how your data.yaml set up?
All the commands I did, assuming an existing installation of Anaconda Navigator, are listed above. I have no idea what "data.yaml" is and have not altered anything.
thank you
---Original--- From: @.> Date: Thu, Aug 15, 2024 00:54 AM To: @.>; Cc: @.**@.>; Subject: Re: [ethz-asl/analog_gauge_reader] Can not get it to run (Issue #22)
All the commands I did, assuming an existing installation of Anaconda Navigator, are listed above. I have no idea what "data.yaml" is and have not altered anything.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
I have Anaconda installed on my windows machine, so I only followed the instructions below
Activate conda environment
. So create the new environment, activate it and install the dependencies via copy&paste of the given commands. I then copied the github repository into a local folderC:/Users/me/.spyder-py3/analog_gauge_reader-main
to get the actual script etc. (this is missing in the installation procedure?).When I now try to run the pipeline script, I get this error (line breaks and spaces added for readability)
In the "results" folder, I can find the original picture, a JSON file with this content:
And run.log with this content:
I also tried to use the gauge_detection_model etc. that are in the "models" folder like this:
And get this error:
Any ideas what I am doing wrong?