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

Attribute Error: module 'tensorflow_datasets.core' has no attribute 'ReadWritePath' #31

Closed
shahpnmlab opened this issue Jun 26, 2023 · 2 comments

Comments

@shahpnmlab
Copy link

Hi,
I am trying to run inference with a toy movie using the following command -
(tapnet) pinot:$ python3 ./experiment.py --config=./configs/tapnet_config.py --jaxline_mode=eval_inference --config.checkpoint_dir=./checkpoint/ --config.experiment_kwargs.config.inference.input_video_path=test_data/ta.mp4 --config.experiment_kwargs.config.inference.output_video_path=result.mp4 --config.experiment_kwargs.config.inference.resize_height=256 --config.experiment_kwargs.config.inference.resize_width=256 --config.experiment_kwargs.config.inference.num_points=20
I have created a virtual conda environment and installed the deps using the requirements.txt file. Running the above command in the virtual env results in the following error -

2023-06-26 20:10:33.108623: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/home/pshah/software/tapnet/./experiment.py", line 32, in <module>
    from kubric.challenges.point_tracking import dataset
  File "/home/pshah/software/miniconda3/lib/python3.10/site-packages/kubric/__init__.py", line 20, in <module>
    from kubric.core.scene import Scene
  File "/home/pshah/software/miniconda3/lib/python3.10/site-packages/kubric/core/__init__.py", line 17, in <module>
    from .scene import Scene
  File "/home/pshah/software/miniconda3/lib/python3.10/site-packages/kubric/core/scene.py", line 20, in <module>
    from kubric.utils import next_global_count
  File "/home/pshah/software/miniconda3/lib/python3.10/site-packages/kubric/utils.py", line 52, in <module>
    from kubric.custom_types import PathLike
  File "/home/pshah/software/miniconda3/lib/python3.10/site-packages/kubric/custom_types.py", line 25, in <module>
    PathLike = Union[str, tfds.core.ReadWritePath]
AttributeError: module 'tensorflow_datasets.core' has no attribute 'ReadWritePath'

Is there a fix for this issue?
TIA!

@yangyi02
Copy link
Collaborator

It may be because the kubric package you installed is outdated.

Could you remove the kubric from python3.10 site-packages and follow the instructions?

Particularly you don't need to install kubric package, just need to download kubric github codebase as a subdirectory,

Install kubric as a subdirectory:

git clone https://github.com/google-research/kubric.git

Install requirements:

pip install -r requirements.txt

@cdoersch
Copy link
Collaborator

cdoersch commented Jun 30, 2023

Looks like tfds.core.ReadWritePath was removed a long time ago (february of last year; tensorflow/datasets@b25e2a2#diff-f6f15af3a15c244b2fe4273df8917f17debb279d192051d58b84b14568406fe1 ). However, custom_types.py doesn't even exist in recent versions of kubric, so this import shouldn't fail if your kubric is new enough.

However, I do see a couple of references to tfds.core.ReadWritePath still in kubric; shouldn't affect your use case, but I'll ping the kubric team about it.

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