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

Error on run EBS sampling (step 3 of Reproducing experiments section) #7

Open
ducmanhnguyen opened this issue Nov 10, 2020 · 1 comment

Comments

@ducmanhnguyen
Copy link

ducmanhnguyen commented Nov 10, 2020

Hi,

I am trying to reproducing the experiments with the blazeit system, after faced the error from issue #6 and I can not fix it, I skip it and move to run the EBS sampling, then it gave another error, could you please help me with this too? Here is the step by step how did I run the experiment:

Reproduce problem:

  • Environment: prepared as requirements
  • Step 1: prepared jackson-town-square video and structure folders as the instruction. (succeed)
  • Step 2: Extract the videos into npy files by run command: python gen_small_vid.py --base_name jackson-town-square --date 2017-12-14 (succeed)
  • Step 3: run EBS sampling by run the command: python blazeit/aggregation/run_ebs_sampling.py --obj_name car --err_tol 0.01 --base_name jackson-town-square --test_date 2017-12-17 --train_date 2017-12-14 then it throw error as bellow:

Error:

Traceback (most recent call last):
File "blazeit/aggregation/run_ebs_sampling.py", line 96, in
main()
File "blazeit/aggregation/run_ebs_sampling.py", line 71, in main
Y_pred, Y_true = get_data(base_name, test_date, obj_name, data_path)
File "blazeit/aggregation/run_ebs_sampling.py", line 40, in get_data
trues = np.zeros(np.max(true_idx.index) + 1)
File "<array_function internals>", line 6, in amax
File "/opt/conda/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 2621, in amax
keepdims=keepdims, initial=initial, where=where)
File "/opt/conda/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 88, in _wrapreduction
return reduction(axis=axis, out=out, **passkwargs)
TypeError: max() got an unexpected keyword argument 'out'

@ducmanhnguyen ducmanhnguyen changed the title [Error on run_ebs_sampling.py] TypeError: max() got an unexpected keyword argument 'out' Error on run EBS sampling (step 3 of Reproducing experiments section) Mar 9, 2021
@ducmanhnguyen
Copy link
Author

Hi,
this bug happended at line 40 in the function get_data of file "run_ebs_sampling.py" (last line in this quote)

def get_data(base_name, date, obj_name, data_path, true_only=False):
    csv_fname = get_csv_fname(data_path, base_name, date)
    df = pd.read_csv(csv_fname)
    df = df[df['object_name'] == obj_name]
    true_idx = df.groupby('frame').size()
    trues = np.zeros(np.max(true_idx.index) + 1)

I found out that the true_idx.index is an <class 'pandas.core.indexes.numeric.Int64Index'> array so somehow it incompatible with the function np.max() of the numpy . so I add a convert this array to numpy array by using function np.array() before doing the np.max() as bellow, then it work:

trues = np.zeros(np.max(np.array(true_idx.index)) + 1)

Could you please confirm this mod/fix is valid?

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

1 participant