Title: TypeError: hog() got an unexpected keyword argument 'block_norm'
Tags: python
Question: import os
from skimage import feature as ft
import cv2
def hog_feature(img_array, resize=(64,64)):
"""extract hog feature from an image.
Args:
img_array: an image array.
resize: size of the image for extracture.
Return:
features:  a ndarray vector.
"""
img = cv2.cvtColor(img_array, cv2.COLOR_BGR2GRAY)
img = cv2.resize(img, resize)
bins = 9
cell_size = (8, 8)
cpb = (2, 2)
norm = "L2"
features = ft.hog(img, orientations=bins, pixels_per_cell=cell_size,
cells_per_block=cpb,block_norm=norm, transform_sqrt=True)
return features
Hog function has this parameter, why is it wrong?
Comment: Please include the complete error message.

Comment: Confirm that you're using a version >= 0.13. `feature.hog` did not take a `block_norm` argument prior to that as far as I can tell - http://scikit-image.org/docs/0.12.x/api/skimage.feature.html?highlight=feature#skimage.feature.hog

Comment: My version is already 0.14，I'll look for it again。



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:01/02/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python>', 'Title': "TypeError: hog() got an unexpected keyword argument 'block_norm'", 'ViewCount': 897, 'id': 54000994, 'user_AboutMe': None, 'user_AccountId': 15041676.0, 'user_DisplayName': 'Jan', 'user_Reputation': 1.0, 'user_Views': 0.0, 'user_id': 10856049.0}}