是否可以在Pycaffe
中阅读和访问解算器属性?
我需要使用解算器文件中存储的一些信息,但显然是使用
import caffe
solver = caffe.get_solver(solver_path)
在这种情况下,没用。有没有其他方法来解决这个问题?
答案 0 :(得分:0)
使用求解器对象后我无法找到自己的东西,最后我写了一个快速函数来解决这个问题:
#define INTERVAL 4
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection: (NSInteger)section {
NSInteger count = arrayRecipeCategoryNAME.count;
NSInteger numberOfUnmappedRows = count / INTERVAL;
NSInteger totalNumberOfRows = (count + numberOfUnmappedRows);
return totalNumberOfRows;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if(((indexPath.row + 1) % INTERVAL) == 0) {
HomeTableViewCell2 *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell2" forIndexPath:indexPath];
return cell;
}
else {
NSInteger numberOfUnmappedCellsBeforeCurrent = indexPath.row / INTERVAL;
//Use following as the index for your datasource arrays
NSInteger translatedIndex = indexPath.row - numberOfUnmappedCellsBeforeCurrent;
HomeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
cell.lblRecipeCategory.text = arrayRecipeCategoryNAME[translatedIndex];
//...
cell.imgRecipeCategory.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@", arrayRecipeCategoryImage[translatedIndex]]];
return cell;
}
}