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

Python error 'int' object has no attribute 'shape' #31

Open
MritulaC opened this issue Jan 19, 2022 · 1 comment
Open

Python error 'int' object has no attribute 'shape' #31

MritulaC opened this issue Jan 19, 2022 · 1 comment

Comments

@MritulaC
Copy link

I kept getting an error " Python error 'int' object has no attribute 'shape'" reflecting to the following line from def train in the dcgan.py file

g_loss = d_on_g.train_on_batch(noise, [1] * BATCH_SIZE))

Solution:
Changing the line to the below worked well:
g_loss = d_on_g.train_on_batch(noise,np.array([1] * BATCH_SIZE))

Correct me if this is wrong!

Hope this is of some help!

Thanks,
Mritula

@Kang-Jack
Copy link

yes, fixed issue on my machine, in same file line ‘d_loss = d.train_on_batch(X, y)’ need be modified to 'd_loss = d.train_on_batch(X, np.array(y))' as well. thx

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

2 participants