Comments (9)
What machine are you running on? All of our work was done on Linux. If you plan working on windows I can help point you in the right direction, but I have never tried running on Windows myself.
from sam.
Sorry for could not elaborate my issue right.
I want to run your already trained model to transform Age Face effects. How can I run those scripts?
from sam.
The README provides a pretty detailed step by step guide for how to run inference on a trained model. Is there a particular part that is not clear?
from sam.
I am trying to execute following command after getting git clone of SAM project in my linux based system,
cd /usr/local/SAM
and under SAM, following is the code:
python scripts/reference_guided_inference.py
--exp_dir=/path/to/experiment
--checkpoint_path=experiment/checkpoints/best_model.pt
--data_path=/path/to/test_data
--test_batch_size=4
--test_workers=4
--ref_images_paths_file=/path/to/ref_list.txt
--latent_mask=8,9
--target_age=50,60,70,80
Do I need to self create folders i.e. "path/to/experiment", "path/to/test_data", "path/to/ref"?
Also, from where would I get "best_model.pt"?
from sam.
Are you sure that scripts/reference_guided_inference.py
is the script you want to run? Are you trying to simply change a given image's age? If so, you should use the regular inference
script.
In any case, yes you need to define the exp_dir
which is where the outputs will be saved. The data path is the path to the directory holding the images you want to run on.
I provided the link for downloading the pretrained model in the README. You should download the model, save it to whatever path you want, and place the chosen path to checkpoint_path
.
from sam.
What are the functionality of following parameters that are used in commands.
- --test_batch_size=4
- --test_workers=4
- --latent_mask=8,9
from sam.
The batch size is the number of images you pass through the network together and the number of workers is a parameter used by the dataloader (you don't need to worry about this one too much).
The latent mask is used to perform style mixing. Here, we specify that we want to perform style mixing with a reference image on layers 8 and 9 of StyleGAN.
Again, just make sure you're running the right script for inference. More details on the functionality of each script is provided in the README.
from sam.
on the execution of following code, I got an error
--****************--
python3 scripts/inference.py
--exp_dir= /to/experiment \
--checkpoint_path= /trainedmodels/sam_ffhq_aging.pt
--data_path= /to/test_data \
--test_batch_size=4
--test_workers=4
--couple_outputs
--target_age=0,10,20,30,40,50,60,70,80
--****************--
Traceback (most recent call last):
File "scripts/inference.py", line 19, in
from models.psp import pSp
File "./models/psp.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 13, in
os.path.join(module_path, 'fused_bias_act_kernel.cu'),
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 974, in load
keep_intermediates=keep_intermediates)
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1179, in _jit_compile
with_cuda=with_cuda)
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1251, in _write_ninja_file_and_build_library
check_compiler_abi_compatibility(compiler)
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 248, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/root/anaconda3/envs/sam_env/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 208, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/root/anaconda3/envs/sam_env/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/root/anaconda3/envs/sam_env/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.
from sam.
I solved it myself
from sam.
Related Issues (20)
- Tflite HOT 1
- No module named 'models.fused_act' HOT 2
- What is the difference between source and target? HOT 2
- How the loss lambdas are set? HOT 3
- Could you please share more details about PCA? HOT 2
- inference error HOT 2
- custom dataset
- Sorry for disturbance ,Environment/sam_env.yaml have some problem HOT 3
- how to finetune the vgg age (DEX) ? HOT 1
- How can we use this model on CPU. HOT 2
- How can I run this on CPU ? HOT 2
- ImportError: No module named 'fused' HOT 3
- Getting Current Age of person HOT 1
- urllib.error.URLError: <urlopen error [Errno 111] Connection refused> HOT 4
- Gray image test results HOT 2
- time issue
- Error When Specifying Multiple Ages for --target_age Parameter In Replicate
- lpips_lambda_aging and l2_lambda_aging
- Could not find face in image. Try another!
- How to duel boot Centos 7.9 Rocky linux 9.3 from same hard disk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sam.