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

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part. #591

Open
iagupov opened this issue Jul 31, 2023 · 5 comments

Comments

@iagupov
Copy link

iagupov commented Jul 31, 2023

File "mtrand.pyx", line 936, in numpy.random.mtrand.RandomState.choice
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part.

I'm following a regular procedure explained in README to run train.py, but I stacked with this error. This error comes from utils\augmentations.py in RandomSampleCrop/_ _ call _ _ at the line mode = random.choice(self.sample_options), but I it's unclear how to fix this.
Thanks for any help

@umang299
Copy link

Facing the same issue.

@elcolie
Copy link

elcolie commented Aug 31, 2023

@iagupov @umang299 Have you solve this problem?

@elcolie
Copy link

elcolie commented Aug 31, 2023

Found the solution. #587

@iagupov
Copy link
Author

iagupov commented Aug 31, 2023

@elcolie Thank you so much!

@ZengQ85
Copy link

ZengQ85 commented Dec 11, 2023

sample_options是这样的不规则形状sample_options = (none,(0.1,none),(0.3,none),(0.5,none),(0.7,none),(none,none))
random.choice不能直接随机选择元素,便化为两阶段,先随机选择下标在赋值
index = random.choice(len(self.sample_options))
mode = self.sample_options[index]

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

4 participants