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

[Question] ValueError: ndarray is not C-contiguous #1062

Open
zichunxx opened this issue May 23, 2024 · 3 comments
Open

[Question] ValueError: ndarray is not C-contiguous #1062

zichunxx opened this issue May 23, 2024 · 3 comments
Labels
question Further information is requested

Comments

@zichunxx
Copy link

zichunxx commented May 23, 2024

Question

Hi! I'm trying to build a training process with image input but met the memory leak problem.

Thus, I want to increase memory efficiency using the FrameStack wrapper with lz4_compress=True.

However, I met ValueError: ndarray is not C-contiguous after wrapping the env with the following code.

import gymnasium as gym
from gymnasium.wrappers import PixelObservationWrapper, RescaleAction, FrameStack
from gymnasium.experimental.wrappers import PixelObservationV0

env = gym.make("Humanoid-v4", render_mode="rgb_array")
env = PixelObservationV0(env, pixels_only=True)
env = RescaleAction(env, min_action=-1.0, max_action=1.0)
env = FrameStack(env, num_stack=frame_stack, lz4_compress=True)
obs, info = env.reset()

Is copy(order='C') missed at this line? Thanks!

Update:

It seems that LazyFrames has been removed after v0.29.1. Why did this class be removed?

@zichunxx zichunxx added the question Further information is requested label May 23, 2024
@pseudo-rnd-thoughts
Copy link
Member

We removed LazyFrame as from my experience it caused more issues and that lazy frame should happen at the replay buffer level not FrameStack level

@zichunxx
Copy link
Author

Could you please offer some examples with LazyFrame at the replay buffer level? Thanks.

@pseudo-rnd-thoughts
Copy link
Member

I'm not aware of any publicly, I have a friend making one but it is still in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants