Skip to content
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

ModuleNotFoundError: No module named 'yaml' and 'einops' #24

Open
RCLaplace opened this issue Jul 25, 2024 · 1 comment
Open

ModuleNotFoundError: No module named 'yaml' and 'einops' #24

RCLaplace opened this issue Jul 25, 2024 · 1 comment

Comments

@RCLaplace
Copy link

Hi
I encountered an issue exporting the operator 'ModuleNotFoundError: No module named 'yaml'' and 'ModuleNotFoundError: No module named 'einops'' when I execute the command python ./preprocessing/main_preprocessing.py
--config ./config/preprocessing.yaml
--data-path D:\work\2024\7\dino-tracker\video

I made sure I have installed the environment according to 'requirements.txt', I also see that it contains the yaml package and einops package using pip list, then I tried to yaml, and still no error

Here is the complete error report:
(track) PS D:\work\2024\7\dino-tracker> python ./preprocessing/main_preprocessing.py --config ./config/preprocessing.yaml --data-path D:\work\2024\7\dino-tracker\video
----- Running python ./preprocessing/extract_trajectories.py --frames-path D:\work\2024\7\dino-tracker\video\video --output-path D:\work\2024\7\dino-tracker\video\of_trajectories\trajectories.pt --min-trajectory-length 2 --threshold 1.5 --infer-res-size 476 854 --filter-using-direct-flow --direct-flow-threshold 2.5
Traceback (most recent call last):
File "D:\work\2024\7\dino-tracker\preprocessing\extract_trajectories.py", line 7, in
from einops import rearrange, repeat
ModuleNotFoundError: No module named 'einops'
----- Running python ./preprocessing/save_dino_embed_video.py --data-path D:\work\2024\7\dino-tracker\video --config ./config/preprocessing.yaml
Traceback (most recent call last):
File "D:\work\2024\7\dino-tracker\preprocessing\save_dino_embed_video.py", line 4, in
import yaml
ModuleNotFoundError: No module named 'yaml'
----- Running python ./preprocessing/save_dino_embed_video.py --data-path D:\work\2024\7\dino-tracker\video --config ./config/preprocessing.yaml --for-mask
Traceback (most recent call last):
File "D:\work\2024\7\dino-tracker\preprocessing\save_dino_embed_video.py", line 4, in
import yaml
ModuleNotFoundError: No module named 'yaml'
----- Running python ./preprocessing/create_fg_mask.py --dino-embed-video-path D:\work\2024\7\dino-tracker\video\dino_embeddings\dino_embed_video-layer=23.pt --h 476 --w 854 --mask-path D:\work\2024\7\dino-tracker\video\masks --fg_mask_threshold 0.6
Traceback (most recent call last):
File "D:\work\2024\7\dino-tracker\preprocessing\create_fg_mask.py", line 5, in
from data.data_utils import save_video_frames
File "D:\work\2024\7\dino-tracker\data\data_utils.py", line 4, in
import imageio
ModuleNotFoundError: No module named 'imageio'
----- Running python ./preprocessing/split_trajectories_to_fg_bg.py --traj_path D:\work\2024\7\dino-tracker\video\of_trajectories\trajectories.pt --fg_masks_path D:\work\2024\7\dino-tracker\video\masks --fg_traj_path D:\work\2024\7\dino-tracker\video\of_trajectories\fg_trajectories.pt --bg_traj_path D:\work\2024\7\dino-tracker\video\of_trajectories\bg_trajectories.pt
Traceback (most recent call last):
File "D:\work\2024\7\dino-tracker\preprocessing\split_trajectories_to_fg_bg.py", line 95, in
split_trajectories_to_fg_bg(args)
File "D:\work\2024\7\dino-tracker\preprocessing\split_trajectories_to_fg_bg.py", line 81, in split_trajectories_to_fg_bg
mask_filter_trajectories(args.traj_path, args.fg_masks_path, args.fg_traj_path, filter_bg=False)
File "D:\work\2024\7\dino-tracker\preprocessing\split_trajectories_to_fg_bg.py", line 56, in mask_filter_trajectories
trajectories = torch.load(traj_path, map_location="cpu")
File "C:\Users\v_ztfang\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 998, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\Users\v_ztfang\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 445, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\Users\v_ztfang\AppData\Roaming\Python\Python39\site-packages\torch\serialization.py", line 426, in init
super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'D:\work\2024\7\dino-tracker\video\of_trajectories\trajectories.pt'
----- Running python ./preprocessing_dino_bb/main_dino_bb_preprocessing.py --config ./config/preprocessing.yaml --data-path D:\work\2024\7\dino-tracker\video
Traceback (most recent call last):
File "D:\work\2024\7\dino-tracker\preprocessing_dino_bb\main_dino_bb_preprocessing.py", line 4, in
import yaml
ModuleNotFoundError: No module named 'yaml'

@tnarek
Copy link
Collaborator

tnarek commented Aug 3, 2024

hi @RCLaplace , what was the output log when installing from requirements.txt?
Did you try to install yaml and einops separately ? (pip install yaml einops)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants