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

AttributeError: 'Row' object has no attribute 'style' #693

Open
DiosMuerto opened this issue Nov 1, 2023 · 40 comments
Open

AttributeError: 'Row' object has no attribute 'style' #693

DiosMuerto opened this issue Nov 1, 2023 · 40 comments

Comments

@DiosMuerto
Copy link

DiosMuerto commented Nov 1, 2023

Help Please :'v

(sadtalker) C:\SadTalker-main>python app_sadtalker.py
Traceback (most recent call last):
File "app_sadtalker.py", line 107, in
demo = sadtalker_demo()
File "app_sadtalker.py", line 35, in sadtalker_demo
with gr.Row().style(equal_height=False):
AttributeError: 'Row' object has no attribute 'style'

@devsnowy
Copy link

devsnowy commented Nov 1, 2023

Same problem, confirmed, fresh install. Please help.

@devsnowy
Copy link

devsnowy commented Nov 1, 2023

I've been testing different commits, can't find out why this is happening.
#692 Same problem here.

@vinthony any help?

@DiosMuerto
Copy link
Author

I don't know what it could be, the old versions worked fine, but now I get that.

I've tried everything.

Reinstall from 0
Remove python and anaconda,
Delete all environments.
Install from the automatic1111 extension,
but nothing, it just doesn't work. that error appears.

:'v

@DiosMuerto
Copy link
Author

I managed to get it working with automatic1111

first delete everything, python and anaconda.

then install https://www.python.org/downloads/release/python-3106/

finally install SADTALKER on the extensions.
Then before restarting I put the checkpoints in the Sadtalker folder and it worked.

I really don't know why it doesn't work if I install it outside of automatic, but if they can solve it it would be excellent.

@devsnowy
Copy link

devsnowy commented Nov 1, 2023

It might be that the launcher script form the extension is not broken?

@AlterunX
Copy link

AlterunX commented Nov 1, 2023

Found I had installed Gradio 4.0.2, but changing to 3.41.2 resolved the problem.

@javarike
Copy link

javarike commented Nov 3, 2023

is that any old version can use?thanks

@umtaran1
Copy link

umtaran1 commented Nov 5, 2023

I can't fix this problem for working on webUI without Auto1111, please help !

@easyontheice
Copy link

easyontheice commented Nov 5, 2023

Replace app_sadtalker.py with this code:

import os, sys
import gradio as gr
from src.gradio_demo import SadTalker  

def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warpfn=None):

sad_talker = SadTalker(checkpoint_path, config_path, lazy_load=True)

with gr.Blocks(analytics_enabled=False) as sadtalker_interface:
    gr.Markdown("<div align='center'> <h2> 😭 SadTalker: Learning Realistic 3D Motion Coefficients for Stylized Audio-Driven Single Image Talking Face Animation (CVPR 2023) </span> </h2> \
                <a style='font-size:18px;color: #efefef' href='https://arxiv.org/abs/2211.12194'>Arxiv</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
                <a style='font-size:18px;color: #efefef' href='https://sadtalker.github.io'>Homepage</a>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
                 <a style='font-size:18px;color: #efefef' href='https://github.com/Winfredy/SadTalker'> Github </div>")
    
    submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary')  # Define the submit button here

    driven_audio = gr.Audio(label="Input audio", type="filepath", elem_id="driven_audio")  # Define the driven_audio variable here

    preprocess_type = gr.Radio(['crop', 'resize','full', 'extcrop', 'extfull'], value='crop', label='preprocess', info="How to handle input image?")  # Define the preprocess_type variable here

    is_still_mode = gr.Checkbox(label="Still Mode (fewer head motion, works with preprocess `full`)", elem_id="is_still_mode")  # Define the is_still_mode variable here

    enhancer = gr.Checkbox(label="GFPGAN as Face enhancer", elem_id="enhancer")  # Define the enhancer variable here

    batch_size = gr.Slider(label="batch size in generation", step=1, maximum=10, value=2, elem_id="batch_size")  # Define the batch_size variable here

    size_of_image = gr.Radio([256, 512], value=256, label='face model resolution', info="use 256/512 model?", elem_id="size_of_image")  # Define the size_of_image variable here

    pose_style = gr.Slider(minimum=0, maximum=46, step=1, label="Pose style", value=0, elem_id="pose_style")  # Define the pose_style variable here

    gen_video = gr.Video(label="Generated video", format="mp4", elem_id="gen_video")  # Define the gen_video variable here

    with gr.Row():
        with gr.Column(variant='panel'):
            with gr.Tabs(elem_id="sadtalker_source_image"):
                with gr.TabItem('Upload image'):
                    with gr.Row():
                        source_image = gr.Image(label="Source image", type="filepath", elem_id="img2img_image")


        if warpfn:
            submit.click(
                        fn=warpfn(sad_talker.test), 
                        inputs=[source_image,
                                driven_audio,
                                preprocess_type,
                                is_still_mode,
                                enhancer,
                                batch_size,                            
                                size_of_image,
                                pose_style
                                ], 
                        outputs=[gen_video]
                        )
        else:
            submit.click(
                        fn=sad_talker.test, 
                        inputs=[source_image,
                                driven_audio,
                                preprocess_type,
                                is_still_mode,
                                enhancer,
                                batch_size,                            
                                size_of_image,
                                pose_style
                                ], 
                        outputs=[gen_video]
                        )

return sadtalker_interface

if __name__ == "__main__":

  demo = sadtalker_demo()
  demo.queue()
  demo.launch()

@umtaran1
Copy link

umtaran1 commented Nov 5, 2023

Replace app_sadtalker.py with this code:

import os, sys
import gradio as gr
from src.gradio_demo import SadTalker  

def sadtalker_demo(checkpoint_path='checkpoints', config_path='src/config', warpfn=None):

sad_talker = SadTalker(checkpoint_path, config_path, lazy_load=True)

with gr.Blocks(analytics_enabled=False) as sadtalker_interface:
    gr.Markdown("<div align='center'> <h2> 😭 SadTalker: Learning Realistic 3D Motion Coefficients for Stylized Audio-Driven Single Image Talking Face Animation (CVPR 2023) </span> </h2> \
                <a style='font-size:18px;color: #efefef' href='https://arxiv.org/abs/2211.12194'>Arxiv</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
                <a style='font-size:18px;color: #efefef' href='https://sadtalker.github.io'>Homepage</a>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
                 <a style='font-size:18px;color: #efefef' href='https://github.com/Winfredy/SadTalker'> Github </div>")
    
    submit = gr.Button('Generate', elem_id="sadtalker_generate", variant='primary')  # Define the submit button here

    driven_audio = gr.Audio(label="Input audio", type="filepath", elem_id="driven_audio")  # Define the driven_audio variable here

    preprocess_type = gr.Radio(['crop', 'resize','full', 'extcrop', 'extfull'], value='crop', label='preprocess', info="How to handle input image?")  # Define the preprocess_type variable here

    is_still_mode = gr.Checkbox(label="Still Mode (fewer head motion, works with preprocess `full`)", elem_id="is_still_mode")  # Define the is_still_mode variable here

    enhancer = gr.Checkbox(label="GFPGAN as Face enhancer", elem_id="enhancer")  # Define the enhancer variable here

    batch_size = gr.Slider(label="batch size in generation", step=1, maximum=10, value=2, elem_id="batch_size")  # Define the batch_size variable here

    size_of_image = gr.Radio([256, 512], value=256, label='face model resolution', info="use 256/512 model?", elem_id="size_of_image")  # Define the size_of_image variable here

    pose_style = gr.Slider(minimum=0, maximum=46, step=1, label="Pose style", value=0, elem_id="pose_style")  # Define the pose_style variable here

    gen_video = gr.Video(label="Generated video", format="mp4", elem_id="gen_video")  # Define the gen_video variable here

    with gr.Row():
        with gr.Column(variant='panel'):
            with gr.Tabs(elem_id="sadtalker_source_image"):
                with gr.TabItem('Upload image'):
                    with gr.Row():
                        source_image = gr.Image(label="Source image", type="filepath", elem_id="img2img_image")


        if warpfn:
            submit.click(
                        fn=warpfn(sad_talker.test), 
                        inputs=[source_image,
                                driven_audio,
                                preprocess_type,
                                is_still_mode,
                                enhancer,
                                batch_size,                            
                                size_of_image,
                                pose_style
                                ], 
                        outputs=[gen_video]
                        )
        else:
            submit.click(
                        fn=sad_talker.test, 
                        inputs=[source_image,
                                driven_audio,
                                preprocess_type,
                                is_still_mode,
                                enhancer,
                                batch_size,                            
                                size_of_image,
                                pose_style
                                ], 
                        outputs=[gen_video]
                        )

return sadtalker_interface

if __name__ == "__main__":

  demo = sadtalker_demo()
  demo.queue()
  demo.launch()

Traceback (most recent call last):
File "C:\Users\Admin\SadTalker\Launcher.py", line 204, in
start()
File "C:\Users\Admin\SadTalker\Launcher.py", line 197, in start
from app_sadtalker import sadtalker_demo
File "C:\Users\Admin\SadTalker\app_sadtalker.py", line 7
sad_talker = SadTalker(checkpoint_path, config_path, lazy_load=True)
^
IndentationError: expected an indented block after function definition on line 5

After I change it, I got that error.

@easyontheice
Copy link

easyontheice commented Nov 5, 2023

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

@umtaran1
Copy link

umtaran1 commented Nov 5, 2023

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

OMG, it's work ♥ Thank you a lot

@easyontheice
Copy link

@umtaran1 Awesome! Glad to hear it. I need to update my posts on the other three threads. Thanks for letting me know.

@secreat14
Copy link

I have just try the latest version and found this error
Traceback (most recent call last):
File "X:\projectwork\lla\TP_T_V\test\SadTalker\venv\lib\site-packages\gradio\queueing.py", line 472, in process_events
response = await self.call_prediction(awake_events, batch)
File "X:\projectwork\lla\TP_T_V\test\SadTalker\venv\lib\site-packages\gradio\queueing.py", line 436, in call_prediction
raise Exception(str(error) if show_error else None) from error
Exception: None

@maggenti
Copy link

maggenti commented Nov 7, 2023

Wow, thanks for that it works like a charm, the Zip file that is. Awesome, thank you so much!

@absahad
Copy link

absahad commented Nov 7, 2023

This error still persist when you try to use sadtalker from google colab, please review. If you try to use one of this files suggested here, it will open but the interface is different and the videos keep loading on a loop.

Let me know!

Main error :

File "app_sadtalker.py", line 35, in sadtalker_demo
with gr.Row().style(equal_height=False):
AttributeError: 'Row' object has no attribute 'style'

@easyontheice
Copy link

easyontheice commented Nov 8, 2023

@secreat14 Can you share your queueing.py file with me? Which version of gradio are you using? I am using gradio 4.1.1, Python ver 3.8.18, Windows 11 os

@absahad
Copy link

absahad commented Nov 8, 2023

@secreat14 Can you share your queueing.py file with me? Which version of gradio are you using? I am using gradio 4.1.1, Python ver 3.8.18, Windows 11 os

This is happenin in Google Colab using any of the Scripts available, also I had the same error on my computer, but in my case I am more worry about Google Colab, here is the link I use, please try to install and you will see the no attribute 'style' Error. https://colab.research.google.com/github/camenduru/SadTalker-colab/blob/main/SadTalker_colab.ipynb <<< that is the link

Sadtalker Issues3
Check Screenshot here.

@duaneking
Copy link

duaneking commented Nov 16, 2023

Confirmed as an issue in the latest code, just bumped into this.

Nothing is working; If I fix the class issue I get :

Audio.init() got an unexpected keyword argument 'source'

This is from a brand new install, it just doesn't work.

@srisonphan
Copy link

@secreat14 Can you share your queueing.py file with me? Which version of gradio are you using? I am using gradio 4.1.1, Python ver 3.8.18, Windows 11 os

Thanks @easyontheice for this hint!

I got a similar issue and fixed it by updating requirements.txt from just gradio to grado~=4.1.1 and relaunch the app through webui.bat on Windows 11 + Python 3.10.6

Note that I applied a fix for gr.Row() mentioned earlier first before hitting this issue :)

@Yacine75005
Copy link

Essayez ce fichier. Je suppose que le code copié n'a pas été correctement mis en retrait.

app_sadtalker.zip

I thank you from the bottom of my heart I spent 1 day on this even though I had the answer with you <33

@uluturksamet
Copy link

uluturksamet commented Nov 30, 2023

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

can u share your checkpoint file? or your sadtalker file?

@chameleonhash
Copy link

Found I had installed Gradio 4.0.2, but changing to 3.41.2 resolved the problem.

Thank you, this worked for me. In virtual env, just

pip uninstall gradio

Yes at prompt

pip install gradio==3.41.2

Then run webui.bat again and link to localhost with UI is provided.

@Gingoold
Copy link

Pruebe este archivo. Supongo que el código copiado no se sangró correctamente.

app_sadtalker.zip

Funcionó perfectamente...
Thanks!!! :)

@2catycm 2catycm mentioned this issue Dec 18, 2023
@Sholgren
Copy link

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

This works great, but it seems like it opens an older version of the UI which does not contain the Reference Video feature. Would you happen to have a version of this file that would have it? Thanks so much.

DavidTsangHW added a commit to DavidTsangHW/SadTalker that referenced this issue Dec 23, 2023
For fixing AttributeError: 'Row' object has no attribute 'style' OpenTalker#693
@DALLYAI
Copy link

DALLYAI commented Dec 31, 2023

Try this file. I'm guessing the copied code didn't indent correctly.
app_sadtalker.zip

OMG, it's work ♥ Thank you a lot

Worked for me too well done, spent hours on it. Thx

@peikenow
Copy link

试试这个文件。我猜复制的代码没有正确缩进。

app_sadtalker.zip

OMG.Thank you so much,Helped me a lot.

@btwiamamin
Copy link

Thanks for the code it worked thank you so much

@SoyVanden
Copy link

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

Hey, I know this might be a dumb question, but I'm a newbie. How do I use your file? Should I execute it, or copy+paste in the webui user text?
Thanks in advance.

@yogesh1012-lgtm
Copy link

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

thanks man

@yogesh1012-lgtm
Copy link

Try this file. I'm guessing the copied code didn't indent correctly.
app_sadtalker.zip

DO this and make sure your face photo is clear , or try different photo

@robertJene
Copy link

using the app_sadtalker.zip file worked for me
to replace the current version of app_sadtalker.py

Why can't the main repo get updated?
What gives?

@ldavis9000aws
Copy link

ldavis9000aws commented Mar 7, 2024

Try this file. I'm guessing the copied code didn't indent correctly.
app_sadtalker.zip

This works great, but it seems like it opens an older version of the UI which does not contain the Reference Video feature. Would you happen to have a version of this file that would have it? Thanks so much.

Agreed - I'm trying to figure out how to get the updated UI after git cloning the dev branch. The propsoed "fix" of just replacing the app_sadtalker.py (which is just called app.py in the dev branch) appears to be geared towards the main build, NOT the dev branch with the updated UI.

@easyontheice
Copy link

Been a while since I revisited this topic I will see about fixing the UI issue and keep you guys updated.

@Xiobio
Copy link

Xiobio commented Apr 5, 2024

Found I had installed Gradio 4.0.2, but changing to 3.41.2 resolved the problem.

Thank you, this worked for me. In virtual env, just

pip uninstall gradio

Yes at prompt

pip install gradio==3.41.2

Then run webui.bat again and link to localhost with UI is provided.

so thankful

@kalichen2021
Copy link

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

How kind you are!! It really works!!

@noahxp
Copy link

noahxp commented May 2, 2024

Try this file. I'm guessing the copied code didn't indent correctly.

app_sadtalker.zip

it works for me, thanks

@robertdeanmoore
Copy link

I used the ZIP workaround and the program ran BUT two issues which I have reported separately

@arafatx
Copy link

arafatx commented Jun 23, 2024

grado~=4.1.1

it's gradio~=4.1.1 not grado

@kalichen2021
Copy link

kalichen2021 commented Jun 23, 2024 via email

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