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

Questions about the "get_class_embedding.py" file #1

Open
zj916716524 opened this issue Mar 24, 2022 · 5 comments
Open

Questions about the "get_class_embedding.py" file #1

zj916716524 opened this issue Mar 24, 2022 · 5 comments

Comments

@zj916716524
Copy link

Hello. I came across your paper and found it very interesting, so I downloaded the code to run it myself. And I want to make my own dataset, I have modified the paths_config.py files. When I run the get_class_embedding.py file, unfortunately it gives me this error "ImportError: No module named 'fused'"

@UniBester
Copy link
Owner

Could you provide the detail of your error?

@zj916716524
Copy link
Author

Thank you very much for your reply, I suspect that I am having problems making my own dataset, I am downloading the dataset of flowers you provided this morning and I plan to make my own dataset after running the dataset you gave me as a reference first. I'll come back chatter if I don't solve the problem.

@zj916716524
Copy link
Author

zj916716524 commented Mar 25, 2022

I downloaded the dataset for flowers and created the packet files with "all_img/test" and "all_img/train", and modifications the config/paths_config.py and config/data_config.py

config/paths_config.py

dataset_paths = {
'af_train': '/home/zeng/AGE-main/all_img/train',
'af_valid': '/home/zeng/AGE-main/all_img/test',
},

config/data_config.py

from configs import transforms_config
from configs.paths_config import dataset_paths
DATASETS = {
'af_encode': {
'transforms': transforms_config.EncodeTransforms,
'train_source_root': dataset_paths['af_train'],
'train_target_root': dataset_paths['af_train'],
'valid_source_root': dataset_paths['af_valid'],
'valid_target_root': dataset_paths['af_valid'],
},
}

The program has reported an error

Traceback (most recent call last):
File "tools/get_class_embedding.py", line 19, in
from models.age import AGE
File "./models/age.py", line 12, in
from models.encoders import psp_encoders
File "./models/encoders/psp_encoders.py", line 8, in
from models.stylegan2.model import EqualLinear
File "./models/stylegan2/model.py", line 7, in
from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
File "./models/stylegan2/op/init.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "./models/stylegan2/op/fused_act.py", line 9, in
fused = load(
File "/home/zeng/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1079, in load
return _jit_compile(
File "/home/zeng/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1317, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "/home/zeng/anaconda3/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1699, in _import_module_from_library
file, path, description = imp.find_module(module_name, [path])
File "/home/zeng/anaconda3/lib/python3.8/imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'fused'

I found that the naming you used in the given dataset is n02085620_25.JPEG_238_24_392_167.jpg, but the data I downloaded from the internet is named image_00033.jpg, did you perform any manipulation in between? Like stitching the original image and the target like zi2zi?

@UniBester
Copy link
Owner

I guess the program error is because there is something wrong with your environment configuration. You can configure your environment using environment/envrionment.yaml.

As for the naming problem, you should rename you data file in the form of catefgory-id_sample_id.jpg. For example, in n02085620_25.JPEG_238_24_392_167.jpg, "n02085620" is the category id and "25.JPEG_238_24_392_167" is the sample id. They are connected by a "_".

@fb-reps
Copy link

fb-reps commented Feb 26, 2023

i down your weight in face dataset,but the opt has no attribution named A_length. the error information is:

Traceback (most recent call last):
File "/home/user/.pycharm_helpers/pydev/pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/user/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/user/Document/fanbing/AGE/tools/get_class_embedding.py", line 82, in
run()
File "/home/user/Document/fanbing/AGE/tools/get_class_embedding.py", line 41, in run
net = AGE(opts)
File "../models/age.py", line 81, in init
self.ax = Ax(self.opts.A_length)
AttributeError: 'Namespace' object has no attribute 'A_length'

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

3 participants