allo- / virtual_webcam_background

Use a virtual webcam background and overlays with body-pix and v4l2loopback
GNU General Public License v3.0
306 stars 48 forks source link

AttributeError: module 'tensorflow._api.v1.image' has no attribute 'resize_with_pad' #70

Closed jolinux closed 3 years ago

jolinux commented 3 years ago

This error

Traceback (most recent call last): File "virtual_webcam.py", line 315, in mainloop() File "virtual_webcam.py", line 179, in mainloop resized_frame = tf.image.resize_with_pad( File "/home/jo/.local/lib/python3.7/site-packages/tensorflow/python/util/deprecation_wrapper.py", line 106, in getattr attr = getattr(self._dw_wrapped_module, name) AttributeError: module 'tensorflow._api.v1.image' has no attribute 'resize_with_pad'

what is the problem. Install from Github today

allo- commented 3 years ago

What tensorflow version are you using?

Here it works with tensorflow==2.3.2 and it may be related to API changes, even when I don't see why it requires the deprecation wrapper for code that uses tf2 functions.

jolinux commented 3 years ago

I don't know the version. Install with the script from github.

How can I check it ?

Jörg

Am Fri, 09 Apr 2021 06:16:49 -0700 schrieb allo- @.***>:

What tensorflow version are you using?

Here it works with tensorflow==2.3.2 and it may be related to API changes, even when I don't see why it requires the deprecation wrapper for code that uses tf2 functions.

jolinux commented 3 years ago

How can I update the version from tensorflow ?

use /.local/lib/python3.7/site-packages$

@.***:~/.local/lib/python3.7/site-packages$ cd tensorflow tensorflow/ tensorflow_estimator-1.14.0.dist-info/ tensorflowjs/ tensorflow-1.14.0.dist-info/ tensorflow_hub/ tensorflowjs-3.3.0.dist-info/ tensorflow_estimator/ tensorflow_hub-0.9.0.dist-info/

Jörg

Am Fri, 09 Apr 2021 06:16:49 -0700 schrieb allo- @.***>:

What tensorflow version are you using?

Here it works with tensorflow==2.3.2 and it may be related to API changes, even when I don't see why it requires the deprecation wrapper for code that uses tf2 functions.

allo- commented 3 years ago

Install the dependencies it in a virtual environment.

virtualenv -p python3.7 ~/venvs/virtual_webcam
source ~/venvs/virtual_webcam/bin/activate
pip install -r requirements.txt
./get-model.sh
jolinux commented 3 years ago

Do this but next error

@.:~$ virtualenv -p python3.7 ~/venvs/virtual_webcam created virtual environment CPython3.7.3.final.0-64 in 869ms creator CPython3Posix(dest=/home/jo/venvs/virtual_webcam, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/jo/.local/share/virtualenv) added seed packages: pip==21.0.1, setuptools==51.0.0, wheel==0.36.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator @.:~$ source ~/venvs/virtual_webcam/bin/activate (virtual_webcam) @.:~$ pip install -r requirements.txt (virtual_webcam) @.:~$ ./get-model.sh bash: ./get-model.sh: Datei oder Verzeichnis nicht gefunden (virtual_webcam) @.***:~$

No file get-model.sh

Must I change to github-DL-path ?

@.***:~/virtual_webcam_background$

Am Fri, 09 Apr 2021 06:30:21 -0700 schrieb allo- @.***>:

Install the dependencies it in a virtual environment.

virtualenv -p python3.7 ~/venvs/virtual_webcam
source ~/venvs/virtual_webcam/bin/activate
pip install -r requirements.txt
./get-model.sh
allo- commented 3 years ago

It's right here in the repo: https://github.com/allo-/virtual_webcam_background/blob/master/get-model.sh

So you should have it in the checked out project.

jolinux commented 3 years ago

I clone the git in ~/virtual_webcam_background and do/start

get-model.sh

was this wrong ?

must i do this

(virtual_webcam) @.***:~$ git clone https://github.com/allo-/virtual_webcam_background.git

and do the installtion again ?

thanks for help

Jörg

Am Fri, 09 Apr 2021 06:39:48 -0700 schrieb allo- @.***>:

It's right here in the repo: https://github.com/allo-/virtual_webcam_background/blob/master/get-model.sh

So you should have it in the checked out project.

jolinux commented 3 years ago

Update tensorflow my local install /.local/lib/python3.7/site-packages$

First deinstall tensorflow update pip and reinstall tensorflow-package new. Now I have version 2.4.1.

No problems any more!!

Close