I want to do interpolation and extrapolation. I can interpolate by using interp2 command. But, this command didn't perform extrapolation. Is there any built-in function for extrapolation in octave? I have given an example in detail.
a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17];
b= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011];
c= [ -0.88 -8.87 -0.86 -0.82 -0.77 -0.71 -0.66 -0.62 -0.57 -0.54 -0.50 -0.47 -0.44 -0.42 -0.39 -0.377 -0.36 -0.89 -0.88 -0.85 -0.81 -0.76 -0.71 -0.66 -0.61 -0.57 -0.53 -0.50 -0.47 -0.44 -0.42 -0.39 -0.37 -0.36];
cc = repmat(c,34,1);
ci= interp2(a, b, cc, 1.5, 0.0015) % Interpolation at some point
ai= [ 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5];
bi= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011];
cim= interp2(a, b, cc, ai, bi) % Interpolation matrix
ce= interp2(a, b, cc, 18, 0.2) % Extrapolation at some point
ae= 4* [ 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5];
be= [ 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111];
cem= interp2(a, b, cc, ae, be) % Extrapolation matrix
How can I find ce and cem in this case? Here, it gives "NA". How should I extrapolate to find ce and cem? This code works in Octave only.
Thanks in advance
Sarah
The most similar command for data outside convex hull in octave to scatteredInterpolant of Matlab is griddata. For more information about griddata, griddata3 and griddatan read octave documentation.
Related
I run the following code for getting data from the NBA API and Im getting the above mentioned error. Any help is appreciated.
from nba_api.stats.endpoints import leaguedashteamstats
import requests
import json
import pandas as pd
response = leaguedashteamstats.LeagueDashTeamStats(
team_id=0,
game_ids= 0,
league_id=0,
season= '2020-21',
season_type_all_star='Regular Season'
Seems like this package has not been updated for about 10 months now. You need to a) include the headers parameter (I believe it's the "Referer" one specifically that the api needs, otherwise it just "hangs" and you'll get a timeout.
But then b) you also need to have the query parameters match what the endpoint needs. Specifically, for, the league_id needs to be '00', having 0 won't work.
I personally am a fan of just going to the source instead of using this wrapper, but it still works given the correct parameters used.
from nba_api.stats.endpoints import leaguedashteamstats
import requests
import json
import pandas as pd
response = leaguedashteamstats.LeagueDashTeamStats(
team_id_nullable='0',
league_id_nullable='00',
season= '2020-21',
season_type_all_star='Regular Season',
headers={'Accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
'Connection': 'keep-alive',
'Host': 'stats.nba.com',
'Origin': 'https://www.nba.com',
'Referer': 'https://www.nba.com/',
'sec-ch-ua': '"Google Chrome";v="87", "\"Not;A\\Brand";v="99", "Chromium";v="87"',
'sec-ch-ua-mobile': '?1',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-site',
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36',
'x-nba-stats-origin': 'stats',
'x-nba-stats-token': 'true'})
df = response.get_data_frames()[0]
Output:
print(df.to_string())
TEAM_ID TEAM_NAME GP W L W_PCT MIN FGM FGA FG_PCT FG3M FG3A FG3_PCT FTM FTA FT_PCT OREB DREB REB AST TOV STL BLK BLKA PF PFD PTS PLUS_MINUS GP_RANK W_RANK L_RANK W_PCT_RANK MIN_RANK FGM_RANK FGA_RANK FG_PCT_RANK FG3M_RANK FG3A_RANK FG3_PCT_RANK FTM_RANK FTA_RANK FT_PCT_RANK OREB_RANK DREB_RANK REB_RANK AST_RANK TOV_RANK STL_RANK BLK_RANK BLKA_RANK PF_RANK PFD_RANK PTS_RANK PLUS_MINUS_RANK CFID CFPARAMS
0 1610612737 Atlanta Hawks 72 41 31 0.569 48.3 40.8 87.2 0.468 12.4 33.4 0.373 19.7 24.2 0.812 10.6 35.1 45.6 24.1 13.2 7.0 4.8 5.0 19.3 19.8 113.7 2.3 1 11 11 11 11 19 23 17 17 19 12 2 4 5 7 10 5 19 9 24 17 17 18 9 13 9 10 Atlanta Hawks
1 1610612738 Boston Celtics 72 36 36 0.500 48.3 41.5 88.9 0.466 13.6 36.4 0.374 16.1 20.8 0.775 10.6 33.6 44.3 23.5 14.1 7.7 5.3 4.6 20.4 19.3 112.6 1.5 1 16 16 16 16 13 11 19 11 10 10 25 25 16 4 22 15 25 16 13 6 11 24 13 16 13 10 Boston Celtics
2 1610612751 Brooklyn Nets 72 48 24 0.667 48.3 43.1 87.3 0.494 14.2 36.1 0.392 18.1 22.5 0.804 8.9 35.5 44.4 26.8 13.5 6.7 5.3 4.6 19.0 18.9 118.6 4.5 1 4 4 4 11 6 21 1 7 12 2 5 8 6 27 5 14 7 13 27 7 9 13 18 2 7 10 Brooklyn Nets
3 1610612766 Charlotte Hornets 72 33 39 0.458 48.2 39.9 87.8 0.455 13.7 37.0 0.369 15.9 20.9 0.761 10.6 33.2 43.8 26.8 14.8 7.8 4.8 4.8 18.0 18.6 109.5 -1.9 1 19 19 19 19 22 20 22 10 9 14 26 24 21 6 25 19 5 24 10 16 14 5 21 23 23 10 Charlotte Hornets
4 1610612741 Chicago Bulls 72 31 41 0.431 48.3 42.2 88.6 0.476 12.6 34.0 0.370 13.8 17.5 0.791 9.6 35.3 45.0 26.8 15.1 6.7 4.2 5.1 18.9 17.7 110.7 -0.9 1 21 21 21 16 10 14 9 16 17 13 30 30 11 19 8 11 8 27 28 27 18 10 30 21 20 10 Chicago Bulls
5 1610612739 Cleveland Cavaliers 72 22 50 0.306 48.4 38.6 85.8 0.450 10.0 29.7 0.336 16.7 22.4 0.743 10.4 32.3 42.8 23.8 15.5 7.8 4.5 5.9 18.2 20.2 103.8 -8.4 1 26 26 26 6 29 28 25 29 28 30 14 9 26 10 28 24 21 29 12 20 29 7 6 30 28 10 Cleveland Cavaliers
6 1610612742 Dallas Mavericks 72 42 30 0.583 48.1 41.1 87.3 0.470 13.8 38.1 0.362 16.5 21.2 0.778 9.1 34.2 43.3 22.9 12.1 6.3 4.3 3.7 19.4 20.1 112.4 2.3 1 8 8 8 24 18 22 13 8 6 18 18 20 15 25 17 21 26 3 30 26 2 19 7 17 11 10 Dallas Mavericks
7 1610612743 Denver Nuggets 72 47 25 0.653 48.6 43.3 89.2 0.485 12.9 34.2 0.377 15.7 19.5 0.803 10.5 33.9 44.4 26.8 13.5 8.1 4.5 4.5 19.1 19.2 115.1 4.9 1 5 5 5 1 4 9 4 15 16 8 27 27 7 8 19 13 5 12 8 21 7 14 15 8 6 10 Denver Nuggets
8 1610612765 Detroit Pistons 72 20 52 0.278 48.4 38.7 85.6 0.452 11.6 32.9 0.351 17.8 23.4 0.759 9.6 33.1 42.7 24.2 14.9 7.4 5.2 5.8 20.5 20.4 106.6 -4.5 1 29 29 29 6 28 29 24 22 21 22 7 5 24 18 26 25 18 25 17 8 28 26 5 27 25 10 Detroit Pistons
9 1610612744 Golden State Warriors 72 39 33 0.542 48.1 41.3 88.2 0.468 14.6 38.7 0.376 16.6 21.1 0.785 8.0 35.1 43.0 27.7 15.0 8.2 4.8 4.3 21.2 19.5 113.7 1.1 1 14 14 14 24 15 17 14 3 5 9 16 21 13 30 12 22 1 26 6 17 6 28 11 12 14 10 Golden State Warriors
10 1610612745 Houston Rockets 72 17 55 0.236 48.1 39.3 88.5 0.444 13.8 40.6 0.339 16.5 22.3 0.740 9.3 33.3 42.6 23.6 14.7 7.6 5.0 5.3 19.5 19.3 108.8 -7.9 1 30 30 30 24 25 15 28 9 3 28 17 10 27 23 24 27 24 23 14 14 21 21 14 24 27 10 Houston Rockets
11 1610612754 Indiana Pacers 72 34 38 0.472 48.5 43.3 91.2 0.474 12.3 34.0 0.364 16.4 20.7 0.792 9.0 33.7 42.7 27.4 13.5 8.5 6.4 5.3 20.2 18.1 115.3 0.0 1 17 17 17 4 3 3 11 18 18 17 20 26 9 26 21 26 2 13 5 1 23 22 26 6 17 10 Indiana Pacers
12 1610612746 LA Clippers 72 47 25 0.653 48.0 41.8 86.7 0.482 14.3 34.7 0.411 16.2 19.3 0.839 9.4 34.7 44.2 24.4 13.2 7.1 4.1 4.2 19.2 18.1 114.0 6.2 1 5 5 5 30 12 25 5 6 14 1 24 28 1 21 14 17 17 7 20 29 5 17 27 10 2 10 LA Clippers
13 1610612747 Los Angeles Lakers 72 42 30 0.583 48.5 40.6 86.1 0.472 11.1 31.2 0.354 17.2 23.3 0.739 9.7 34.6 44.2 24.7 15.2 7.8 5.4 4.5 19.1 21.3 109.5 2.8 1 8 8 8 4 21 27 12 25 24 21 11 6 28 17 15 16 15 28 11 5 8 16 3 22 8 10 Los Angeles Lakers
14 1610612763 Memphis Grizzlies 72 38 34 0.528 48.3 42.8 91.8 0.467 11.2 31.4 0.356 16.4 21.3 0.771 11.2 35.3 46.5 26.9 13.3 9.1 5.1 5.2 18.7 18.3 113.3 1.0 1 15 15 15 11 7 2 18 24 23 20 19 17 18 2 9 4 4 10 1 12 20 9 25 15 15 10 Memphis Grizzlies
15 1610612748 Miami Heat 72 40 32 0.556 48.3 39.2 83.7 0.468 12.9 36.2 0.358 16.7 21.1 0.790 8.0 33.5 41.5 26.3 14.1 7.9 4.0 4.0 18.9 19.6 108.1 0.0 1 13 13 13 16 26 30 15 14 11 19 13 21 12 29 23 29 9 17 9 30 4 12 10 25 16 10 Miami Heat
16 1610612749 Milwaukee Bucks 72 46 26 0.639 48.1 44.7 91.8 0.487 14.4 37.1 0.389 16.2 21.4 0.760 10.3 37.8 48.1 25.5 13.8 8.1 4.6 4.8 17.3 18.3 120.1 5.9 1 7 7 7 22 1 1 3 5 8 5 23 16 23 12 1 2 14 15 7 19 15 2 24 1 3 10 Milwaukee Bucks
17 1610612750 Minnesota Timberwolves 72 23 49 0.319 48.3 40.7 90.9 0.448 13.1 37.6 0.349 17.6 23.1 0.761 10.5 33.0 43.5 25.6 14.3 8.8 5.5 5.5 20.9 19.9 112.1 -5.6 1 25 25 25 11 20 6 27 12 7 25 8 7 22 9 27 20 11 19 3 3 26 27 8 18 26 10 Minnesota Timberwolves
18 1610612740 New Orleans Pelicans 72 31 41 0.431 48.4 42.5 89.1 0.477 10.6 30.4 0.348 19.0 26.1 0.729 11.7 35.7 47.4 26.0 14.6 7.6 4.4 5.9 18.0 21.3 114.6 -0.3 1 21 21 21 6 9 10 7 27 25 26 4 2 29 1 3 3 10 22 15 24 30 4 2 9 18 10 New Orleans Pelicans
19 1610612752 New York Knicks 72 41 31 0.569 48.4 39.4 86.5 0.456 11.8 30.0 0.392 16.4 20.9 0.784 9.7 35.5 45.1 21.4 12.9 7.0 5.1 5.4 20.5 17.9 107.0 2.3 1 11 11 11 6 24 26 21 21 27 3 21 23 14 16 7 9 29 6 21 11 25 25 29 26 10 10 New York Knicks
20 1610612760 Oklahoma City Thunder 72 22 50 0.306 48.2 38.8 88.0 0.441 11.9 35.1 0.339 15.5 21.3 0.725 9.9 35.7 45.6 22.1 16.1 7.0 4.4 5.3 18.1 18.6 105.0 -10.6 1 26 26 26 19 27 19 29 20 13 29 29 17 30 14 3 6 27 30 23 23 21 6 23 28 30 10 Oklahoma City Thunder
21 1610612753 Orlando Magic 72 21 51 0.292 48.1 38.3 89.2 0.429 10.9 31.8 0.343 16.6 21.4 0.775 10.4 35.1 45.4 21.8 12.8 6.9 4.4 5.3 17.2 18.6 104.0 -9.3 1 28 28 28 22 30 8 30 26 22 27 15 15 17 11 10 7 28 5 25 22 24 1 20 29 29 10 Orlando Magic
22 1610612755 Philadelphia 76ers 72 49 23 0.681 48.4 41.4 86.9 0.476 11.3 30.1 0.374 19.6 25.5 0.767 10.0 35.0 45.1 23.7 14.4 9.1 6.2 4.7 20.2 21.0 113.6 5.6 1 3 3 3 6 14 24 8 23 26 11 3 3 20 13 13 10 22 21 1 2 12 23 4 14 5 10 Philadelphia 76ers
23 1610612756 Phoenix Suns 72 51 21 0.708 48.6 43.3 88.3 0.490 13.1 34.6 0.378 15.6 18.7 0.834 8.8 34.2 42.9 26.9 12.5 7.2 4.3 3.6 19.1 18.0 115.3 5.8 1 2 2 2 1 2 16 2 13 15 7 28 29 2 28 18 23 3 4 19 25 1 14 28 7 4 10 Phoenix Suns
24 1610612757 Portland Trail Blazers 72 42 30 0.583 48.1 41.3 91.1 0.453 15.7 40.8 0.385 17.8 21.6 0.823 10.6 33.9 44.5 21.3 11.1 6.9 5.0 4.6 18.9 19.1 116.1 1.8 1 8 8 8 24 15 4 23 2 2 6 6 13 3 3 20 12 30 1 25 13 10 10 16 5 12 10 Portland Trail Blazers
25 1610612758 Sacramento Kings 72 31 41 0.431 48.1 42.6 88.6 0.481 12.1 33.3 0.364 16.4 22.0 0.745 9.4 32.0 41.4 25.5 13.4 7.5 5.0 4.7 19.4 18.7 113.7 -3.7 1 21 21 21 24 8 13 6 19 20 16 21 11 25 22 30 30 12 11 16 15 13 20 19 11 24 10 Sacramento Kings
26 1610612759 San Antonio Spurs 72 33 39 0.458 48.6 41.9 90.5 0.462 9.9 28.4 0.350 17.4 22.0 0.792 9.3 34.6 43.9 24.4 11.4 7.0 5.1 5.1 18.0 18.6 111.1 -1.7 1 19 19 19 1 11 7 20 30 30 24 9 12 10 24 16 18 16 2 22 10 19 3 22 20 21 10 San Antonio Spurs
27 1610612761 Toronto Raptors 72 27 45 0.375 48.1 39.7 88.7 0.448 14.5 39.3 0.368 17.4 21.3 0.815 9.4 32.1 41.6 24.1 13.2 8.6 5.4 5.6 21.2 19.5 111.3 -0.5 1 24 24 24 24 23 12 26 4 4 15 10 17 4 20 29 28 20 8 4 4 27 28 12 19 19 10 Toronto Raptors
28 1610612762 Utah Jazz 72 52 20 0.722 48.2 41.3 88.1 0.468 16.7 43.0 0.389 17.2 21.5 0.799 10.6 37.6 48.3 23.7 14.2 6.6 5.2 3.9 18.5 19.0 116.4 9.3 1 1 1 1 19 17 18 16 1 1 4 12 14 8 4 2 1 23 18 29 8 3 8 17 4 1 10 Utah Jazz
29 1610612764 Washington Wizards 72 34 38 0.472 48.3 43.2 90.9 0.475 10.2 29.0 0.351 20.1 26.2 0.769 9.7 35.5 45.2 25.5 14.4 7.3 4.1 4.8 21.6 22.0 116.6 -1.8 1 17 17 17 11 5 5 10 28 29 23 1 1 19 15 6 8 13 20 18 28 15 30 1 3 22 10 Washington Wizards
I'm trying to fine-tune tesseract 4.1.1 on my own specific data according to this guide. I want it to become able to detect and recognize text in boxes like that:
I have generated a number of images like that and corresponding to them .box files containing bounding boxes with text. To reproduce my issue here i'm going to show my pipeline using only one image. Here is the .box file for the image above:
0 1804 1659 1858 1813 0
5 1804 1659 1858 1813 0
9 1804 1659 1858 1813 0
9 1266 715 1334 1169 0
7 1266 715 1334 1169 0
8 1266 715 1334 1169 0
3 1266 715 1334 1169 0
6 1266 715 1334 1169 0
8 1266 715 1334 1169 0
0 1266 715 1334 1169 0
5 1266 715 1334 1169 0
3 1266 715 1334 1169 0
2 876 303 930 607 0
7 876 303 930 607 0
2 876 303 930 607 0
8 876 303 930 607 0
2 876 303 930 607 0
2 876 303 930 607 0
8 1671 120 1725 224 0
0 1671 120 1725 224 0
5 300 1278 354 1482 0
2 300 1278 354 1482 0
3 300 1278 354 1482 0
7 300 1278 354 1482 0
7 917 1451 975 1605 0
6 917 1451 975 1605 0
4 917 1451 975 1605 0
1 1058 1310 1132 1716 0
9 1058 1310 1132 1716 0
8 1058 1310 1132 1716 0
7 1058 1310 1132 1716 0
7 1058 1310 1132 1716 0
1 1058 1310 1132 1716 0
8 1058 1310 1132 1716 0
6 1058 1310 1132 1716 0
3 998 76 1070 382 0
4 998 76 1070 382 0
4 998 76 1070 382 0
8 998 76 1070 382 0
3 998 76 1070 382 0
6 998 76 1070 382 0
3 722 548 776 652 0
2 722 548 776 652 0
7 1782 1332 1838 1586 0
7 1782 1332 1838 1586 0
2 1782 1332 1838 1586 0
6 1782 1332 1838 1586 0
2 1782 1332 1838 1586 0
1 714 140 768 244 0
2 714 140 768 244 0
0 220 500 278 754 0
5 220 500 278 754 0
5 220 500 278 754 0
6 220 500 278 754 0
6 220 500 278 754 0
8 1676 1052 1742 1406 0
4 1676 1052 1742 1406 0
5 1676 1052 1742 1406 0
9 1676 1052 1742 1406 0
1 1676 1052 1742 1406 0
2 1676 1052 1742 1406 0
4 1676 1052 1742 1406 0
5 357 161 419 317 0
1 357 161 419 317 0
4 357 161 419 317 0
9 1424 848 1480 952 0
8 1424 848 1480 952 0
0 438 324 498 478 0
6 438 324 498 478 0
9 438 324 498 478 0
8 1503 1246 1559 1700 0
1 1503 1246 1559 1700 0
8 1503 1246 1559 1700 0
5 1503 1246 1559 1700 0
3 1503 1246 1559 1700 0
0 1503 1246 1559 1700 0
5 1503 1246 1559 1700 0
5 1503 1246 1559 1700 0
4 1503 1246 1559 1700 0
8 1553 477 1609 581 0
4 1553 477 1609 581 0
3 527 258 581 512 0
7 527 258 581 512 0
7 527 258 581 512 0
9 527 258 581 512 0
1 527 258 581 512 0
6 1665 1592 1727 1748 0
8 1665 1592 1727 1748 0
3 1665 1592 1727 1748 0
5 595 1362 651 1766 0
9 595 1362 651 1766 0
3 595 1362 651 1766 0
9 595 1362 651 1766 0
4 595 1362 651 1766 0
3 595 1362 651 1766 0
3 595 1362 651 1766 0
1 595 1362 651 1766 0
I have also converted the image into .tiff format and placed it in the same directory with .box file. Lets say we have 87.tiff and 87.box inside the directory.
Next i generate 87.lstmf file using
tesseract 87.tiff 87 lstm.train
Next i extract model using
combine_tessdata -e /usr/share/tesseract-ocr/4.00/tessdata/rus.traineddata lstm_model/rus.lstm
Next i create train.txt file containing the single line: 87.lstmf
Finally, i create bash script train.sh
/usr/bin/lstmtraining \
--model_output output/fine_tuned \
--continue_from lstm_model/rus.lstm \
--traineddata /usr/share/tesseract-ocr/4.00/tessdata/rus.traineddata \
--train_listfile train.txt \
--eval_listfile train.txt \
--max_iterations 400\
--debug_level -1
And when i run it, i have the following logs:
$ bash train.sh
Loaded file lstm_model/rus.lstm, unpacking...
Warning: LSTMTrainer deserialized an LSTMRecognizer!
Continuing from lstm_model/rus.lstm
Loaded 1/1 lines (1-1) of document 87.lstmf
Loaded 1/1 lines (1-1) of document 87.lstmf
Compute CTC targets failed!
Compute CTC targets failed!
Compute CTC targets failed!
Compute CTC targets failed!
The message "Compute CTC targets failed!" repeats infinitely until i interrupt the script.
What am i doing wrong? I'm also concerned about message "Loaded 1/1 lines (1-1)" since i have multiple bounding boxes on the image.
For lstm training on images you may need to have the .box files in the new lstm format (these can be generated by running tesseract with the lstmbox argument):
TrainingTesseract-4.00
so after each line of text mark it with a special line:
<tab> <left> <bottom> <right> <top> <page>
then run lstm.train .
I have 8 RTX GPUs. When run p2pBandwidthLatencyTest, The latencies between GPU0 and GPU1, GPU2 and GPU3, GPU4 and GPU5, GPU6 and GPU7 is 40,000 times slower than other pairs:
P2P=Enabled Latency (P2P Writes) Matrix (us)
GPU 0 1 2 3 4 5 6 7
0 1.80 49354.72 1.70 1.70 1.74 1.74 1.74 1.72
1 49354.84 1.37 1.70 1.69 1.74 1.76 1.73 1.72
2 1.88 1.81 1.73 49355.00 1.79 1.76 1.76 1.75
3 1.88 1.79 49354.85 1.33 3.79 3.84 3.88 3.91
4 1.89 1.88 1.90 1.87 1.72 49354.96 3.49 3.56
5 2.30 1.93 1.88 1.89 49354.89 1.32 3.63 3.60
6 2.55 2.53 2.37 2.29 2.24 2.26 3.50 49354.77
7 2.30 2.27 2.29 1.87 1.82 1.83 49354.85 1.36
Compare it with when peer-to-peer is disabled:
P2P=Disabled Latency Matrix (us)
GPU 0 1 2 3 4 5 6 7
0 1.80 14.31 13.86 13.49 14.52 13.89 13.58 13.58
1 13.71 1.82 14.44 13.95 14.65 13.62 15.05 15.20
2 13.38 14.23 1.73 16.59 13.77 15.44 14.10 13.64
3 12.68 15.62 12.50 1.77 14.92 15.01 15.17 14.87
4 13.51 13.60 15.09 13.40 1.27 12.48 12.68 19.47
5 14.92 13.84 13.42 13.42 16.53 1.30 16.37 16.60
6 14.29 13.62 14.66 13.62 14.90 13.70 1.32 14.33
7 14.26 13.42 14.35 13.53 16.89 14.26 17.03 1.36
Is this normal?
It turns out the super slow peer-to-peer is abnormal.
After I disable IOMMU (Intel VT-d) in the BIOS, the problem is gone:
P2P=Enabled Latency (P2P Writes) Matrix (us)
GPU 0 1 2 3 4 5 6 7
0 1.34 1.22 1.68 1.69 1.71 1.70 1.75 1.73
1 1.20 1.38 1.70 1.67 1.71 1.75 1.75 1.72
2 1.69 1.67 1.29 1.20 1.73 1.75 1.75 1.75
3 1.69 1.66 1.17 1.29 1.74 1.75 1.72 1.73
4 1.72 1.76 1.74 1.70 1.32 1.13 1.66 1.70
5 1.74 1.73 1.75 1.74 1.18 1.28 1.67 1.69
6 1.75 1.74 1.74 1.72 1.67 1.68 1.31 1.19
7 1.76 1.75 1.73 1.73 1.67 1.69 1.18 1.32
It seems the problem is the same as or is very similar to discussions in:
https://github.com/pytorch/pytorch/issues/1637
https://github.com/pytorch/pytorch/issues/24081
A few possible solutions are mentioned in the discussions:
Disable IOMMU:
https://github.com/pytorch/pytorch/issues/1637#issuecomment-338268158
https://github.com/pytorch/pytorch/issues/1637#issuecomment-401422046
Disable ACS:
https://github.com/pytorch/pytorch/issues/24081#issuecomment-557074611
https://github.com/pytorch/pytorch/issues/24081#issuecomment-547976127
My system having the problem only had IOMMU enabled in the BIOS. ACS was not turned on as lspci -vvv | grep ACS got back nothing.
==============================
Background on I/O MMU:
https://en.wikipedia.org/wiki/X86_virtualization#I/O_MMU_virtualization_(AMD-Vi_and_Intel_VT-d)
It's part of the x86 virtualization. It's the virtualization done by the chipset. Besides the name IOMMU, it's also called AMD-Vi or Intel VT-d. Not to be confused with AMD-V and Intel VT-x which are virtualization via the CPU.
I've defined some faces in X3D and am trying to assign colours to them. I have the code below, but when I load the model, nothing appears and it just shows "hardware buffering". It loads ok (and shape is correct) when I get rid of the parts related to colour definition. Any ideas what's wrong here? Thanks!
<x3d>
<Scene>
<Group>
<Transform translation="0 1.829 0">
<Transform center="0 -1.829 0" rotation="0.0000 0.0000 -1.0000 1.5708" translation="18.288 -3.658 11.582">
<Transform center="0 -1.829 0" rotation="0 1 0 0.0000">
<Shape>
<Appearance><Material diffuseColor="0.0000 0.0000 1.0000"/></Appearance>
<IndexedFaceSet solid='true' coordIndex='0 1 2 3 -1 7 6 5 4 -1 0 4 5 1 -1 1 5 6 2 -1 2 6 7 3 -1 3 7 4 0 -1'>
<Coordinate point='-0.004 1.829 0.174 0.004 1.829 0.174 0.004 1.829 -0.174 -0.004 1.829 -0.174 -0.004 -1.829 0.174 0.004 -1.829 0.174 0.004 -1.829 -0.174 -0.004 -1.829 -0.174'/>
</IndexedFaceSet>
</Shape>
<Shape>
<Appearance><Material/></Appearance>
<IndexedFaceSet colorPerVertex='false' solid='true' colorIndex='1 1 0 1 1 1' coordIndex='0 1 2 3 -1 7 6 5 4 -1 0 4 5 1 -1 1 5 6 2 -1 2 6 7 3 -1 3 7 4 0 -1'>
<Color color="0.8627 0.8627 0.8627 0.0000 0.0000 1.0000"/>
<Coordinate point='-0.1015 1.829 0.174 0.1015 1.829 0.174 0.1015 1.829 0.16 -0.1015 1.829 0.16 -0.1015 -1.829 0.174 0.1015 -1.829 0.174 0.1015 -1.829 0.16 -0.1015 -1.829 0.16'/>
</IndexedFaceSet>
</Shape>
</Transform>
</Transform>
</Transform>
</Group>
</Scene>
</x3d>
The code was correct but the reason it wasn't working was that I was creating an .html file rather than an .xhtml file for x3dom.
I want to plot a 3D plane in GNU Octave using the surf command.
I have following data
e.g
a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17];
b= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011];
c= [ -0.88 -8.87 -0.86 -0.82 -0.77 -0.71 -0.66 -0.62 -0.57 -0.54 -0.50 -0.47 -0.44 -0.42 -0.39 -0.377 -0.36 -0.89 -0.88 -0.85 -0.81 -0.76 -0.71 -0.66 -0.61 -0.57 -0.53 -0.50 -0.47 -0.44 -0.42 -0.39 -0.37 -0.36];
I could plot it using plot3 command..
But how should I plot it by using surf command in GNU Octave?
If you want to do surf(a,b,c) then c must be a matrix of size m x n where m is the length of vector a and n the length of vector b. In your case, you could do something like:
cc = repmat(c,34,1);
surf(a,b,cc)
but I don't know if that's what you are expecting. Basically, for each value of x and y, you need a value of z.