Comments (4)
if use tensorflow,change model.predict to "
def predict(self, image):
if image.shape != (1, 3, IMAGE_SIZE, IMAGE_SIZE):
image = resize_with_pad(image)
if K.image_dim_ordering() == 'th':
image = image.reshape((1, 3, IMAGE_SIZE, IMAGE_SIZE))
else:
image = image.reshape((1, IMAGE_SIZE, IMAGE_SIZE ,3))
image = image.astype('float32')
image /= 255
result = self.model.predict_proba(image)
print(result)
result = self.model.predict_classes(image)
return result[0]
"
then the "Exception: Error when checking : expected convolution2d_input_1 to have shape (None, 64, 64, 3) but got array with shape (1, 3, 64, 64)" disappear.
from bosssensor.
what is your image_dim_ordering? th or tf?
from bosssensor.
/Users/Jason/ML/BossSensor/camera_reader.py
Using TensorFlow backend.
Model Loaded.
Traceback (most recent call last):
face detected
File "/Users/Jason/ML/BossSensor/camera_reader.py", line 36, in
result = model.predict(image)
File "/Users/Jason/ML/BossSensor/boss_train.py", line 159, in predict
result = self.model.predict_proba(image)
File "/usr/local/lib/python2.7/site-packages/keras/models.py", line 758, in predict_proba
preds = self.predict(x, batch_size, verbose)
File "/usr/local/lib/python2.7/site-packages/keras/models.py", line 671, in predict
return self.model.predict(x, batch_size=batch_size, verbose=verbose)
File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 1161, in predict
check_batch_dim=False)
File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 108, in standardize_input_data
str(array.shape))
Exception: Error when checking : expected convolution2d_input_1 to have shape (None, 64, 64, 3) but got array with shape (1, 3, 64, 64)
Cleaned up camera.
I also have this error, how to resolve.
from bosssensor.
I also got this error. my image_dim_ordering is "tf". could it be the reason that I have different sized images in the training folders?
from bosssensor.
Related Issues (20)
- UnboundLocalError: local variable 'epoch_logs' referenced before assignment HOT 5
- Which MacOSX Version is Optimal for this installation ? HOT 1
- how to conceal camera?
- run boss_train.py error HOT 1
- IOError: Unable to create file HOT 3
- OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 9748
- local variable 'epoch_logs' referenced before assignment HOT 2
- run camera.py error HOT 1
- detecting problem in finally HOT 4
- Problems in boss_train.py HOT 4
- Can this project work on Windows10
- 牛逼 HOT 9
- No matter who comes, the it always remind me boss is approaching!
- ModuleNotFoundError: No module named 'PyQt4' HOT 2
- Problems about './store/model.h5' HOT 1
- Why do you divide the data set like this?
- 你这程序最好没有bug 不然我摸鱼被老板抓到 打死你【狗头】 HOT 1
- 能否做个简易安装包
- 全世界无产阶级联合起来摸鱼!世界のプロレタリアートは団結して仕事でふざけよう!The proletariat of the world unite to goof off at work! HOT 1
- Hjkk HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bosssensor.